This is PriorityQueue.h in view mode; [Download] [Up]
/* NAME: ** PriorityQueue:Object ** ** COPYRIGHT 1992 BY ONYSCHUK AND ASSOCIATES ** ALL RIGHTS RESERVED. ** ** REVISION HISTORY: ** Sun Aug 16 14:14:03 EDT 1992 Mark Onyschuk ** Starting point. ** ** DESCRIPTION: ** A priority queue which dequeues objects by ** unsigned integer priority. ** ** NOTE: priorityOf(n) > priorityOf(n + 1) ** ** DISCLAIMER: ** This is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as ** published by the Free Software Foundation; either version ** 1, or (at your option) any later version. ** ** This program is distributed in the hope that it will be ** useful, but WITHOUT ANY WARRANTY; without even the implied ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ** PURPOSE. See the GNU General Public License for more ** details. ** ** You should have received a copy of the GNU General Public ** License along with this program; if not, write to the Free ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA ** 02139, USA. */ #import <objc/Object.h> typedef struct _NODE { unsigned int priority; id object; } NODE; @interface PriorityQueue:Object { NODE *heap; unsigned int size, top; } /* INITIALIZING A PRIORITY QUEUE ****************************************/ - init; - initCount:(int)count; /* COPYING AND FREEING A PRIORITY QUEUE *********************************/ - copyFromZone:(NXZone *)zone; - free; /* QUEUEING AND DEQUEUEING OBJECTS BY PRIORITY **************************/ - addObject:anObject withPriority:(unsigned int)priority; - removeObject; /* COUNTING THE NUMBER OF OBJECTS IN A PRIORITY QUEUE *******************/ - (unsigned int)count; /* DETERMINING THE HIGHEST PRIORITY IN A PRIORITY QUEUE *****************/ - (unsigned int)highestPriority; /* EMPTYING A PRIORITY QUEUE ********************************************/ - empty; - freeObjects; /* COMPARING AND COMBINING PRIORITY QUEUES ******************************/ - (BOOL)isEqual:anObject; - appendQueue:(PriorityQueue *)otherQueue; /* GETTING AND SETTING THE CAPACITY OF A PRIORITY QUEUE *****************/ - (unsigned int)capacity; - setAvailableCapacity:(unsigned int)capacity; /* SENDING MESSAGES TO OBJECTS ******************************************/ - makeObjectsPerform:(SEL)aSelector; - makeObjectsPerform:(SEL)aSelector with:anObject; /* ARCHIVING ************************************************************/ - read:(NXTypedStream *)stream; - write:(NXTypedStream *)stream; @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.