OSOrderedSet
Member Functions
Abstract: A member function to query the set for the presence of a particular object.
public:
virtual bool containsObject(const OSObject *anObject) const;
Parameters
Name | Description |
anObject | The object to be located. |
Result: Returns true if the object is present in the set, false otherwise.
Abstract: A member function to expand the size of the collection.
public:
virtual unsigned int ensureCapacity(unsigned int newCapacity);
Parameters
Name | Description |
newCapacity | The new size capacity for the collection. |
Result: Returns new capacity of the set when successful or the old capacity on failure.
Abstract: A member function to remove and release all items in the set.
public:
virtual void flushCollection();
Abstract: A member function to release and deallocate any resources used by the instance of OSOrderedSet.
public:
virtual void free();
Abstract: A member function to return the storage capacity of the collection.
public:
virtual unsigned int getCapacity() const;
Result: Returns the total storage capacity of the set.
Abstract: A member function to get the size by which the collection will grow.
public:
virtual unsigned int getCapacityIncrement() const;
Result: Returns the current growth size.
Abstract: A member function to return the number of objects within the collection.
public:
virtual unsigned int getCount() const;
Result: Returns the number of items in the set.
Abstract: A member function to return the first object in the set.
public:
virtual OSObject *getFirstObject() const;
Result: Returns the object ordered first in the set or 0 if none exist.
Abstract: A member function to return the last object in the set.
public:
virtual OSObject *getLastObject() const;
Result: Returns the object ordered last in the set or 0 if none exist.
Abstract: A member function to return a reference to an object at a particular index.
public:
virtual OSObject *getObject( unsigned int index) const;
Parameters
Name | Description |
index | The index into the set. |
Result: Returns a reference to the object at the given index, 0 if none exist at that location.
Abstract: A member function to return a the ordering context.
public:
virtual void *getOrderingRef();
Result: Returns the ordering context, or NULL if none exist.
Abstract: A member function for initializing an instance of OSOrderedSet.
public:
virtual bool initWithCapacity(unsigned int capacity,
OSOrderFunction orderFunc = 0,
void * orderingRef = 0);
Parameters
Name | Description |
capacity | The initial storage size in number of objects of the set. |
orderFunc | A c-style function which implements the sorting algorithm for the set. |
orderingRef | A ordering context used as a hint for ordering objects within the set. |
Result: Returns true if initialization was successful, or false if a failure occurred.
Abstract: A member function to test the equality between an OSOrderedSet object and the receiver.
public:
virtual bool isEqualTo(OSOrderedSet *anOrderedSet) const;
Parameters
Name | Description |
anOrderedSet | The OSOrderedSet object to be compared against the receiver. |
Result: Returns true if the two objects are equivalent, false otherwise.
Abstract: A member function to test the equality between an arbitrary OSObject derived object and the receiver.
public:
virtual bool isEqualTo(const OSObject *anObject) const;
Parameters
Name | Description |
anObject | The OSObject derived object to be compared against the receiver. |
Result: Returns true if the two objects are equivalent, false otherwise.
Abstract: A member function to query the set for the presence of a particular object.
public:
virtual bool member(const OSObject *anObject) const;
Parameters
Name | Description |
anObject | The object to be located. |
Result: Returns true if the object is present in the set, false otherwise.
Abstract: A member function to return the ordering value of an object.
public:
virtual SInt32 orderObject( OSObject * anObject );
Parameters
Name | Description |
anObject | The object to be queried. |
Result: Returns the ordering value for an object.
Abstract: A member function to remove and release an object in the set.
public:
virtual void removeObject(OSObject *anObject);
Parameters
Name | Description |
anObject | The object to remove from the set. |
Abstract: A member function to set the size by which the collection will grow.
public:
virtual unsigned int setCapacityIncrement(unsigned increment);
Parameters
Name | Description |
increment | The new growth factor for the set. |
Result: Returns new growth size.
Abstract: A member function to place an OSObject derived object order it first in the set.
public:
virtual bool setFirstObject(OSObject *anObject);
Parameters
Name | Description |
anObject | The object to be placed into the collection. |
Result: Returns true if object was successfully added to the collection, false otherwise.
Abstract: A member function to place an OSObject derived object order it last in the set.
public:
virtual bool setLastObject(OSObject *anObject);
Parameters
Name | Description |
anObject | The object to be placed into the collection. |
Result: Returns true if object was successfully added to the collection, false otherwise.
Abstract: A member function to place an OSObject derived object into the set. The object will be automatically sorted in the set.
public:
virtual bool setObject(OSObject *anObject);
Parameters
Name | Description |
anObject | The object to be placed into the collection. |
Result: Returns true if object was successfully added to the collection, false otherwise.
Abstract: A member function to place an object into the set at a particular index.
public:
virtual bool setObject(unsigned int index, OSObject *anObject);
Parameters
Name | Description |
index | The index in the set to place the object. |
anObject | The object to be placed into the set. |
Result: Returns true if the object was successfully placed into the collection, false otherwise.
Abstract: A static constructor function for creating and initializing an instance of OSOrderedSet.
public:
static OSOrderedSet *withCapacity(unsigned int capacity,
OSOrderFunction orderFunc = 0,
void * orderingRef = 0);
Parameters
Name | Description |
capacity | The initial storage size in number of objects of the set. |
orderFunc | A c-style function which implements the sorting algorithm for the set. |
orderingRef | A ordering context used as a hint for ordering objects within the set. |
Result: Returns an instance of OSSet, or 0 if a failure occurred.
Member Data
public:typedef SInt32 (*OSOrderFunction)( OSObject * obj1, OSObject * obj2, void * ref );
Parameters
Name | Description |
obj1 | An object from the collection. |
obj2 | An object to be compared to obj1. |
ref | The ordering conext used by the sorting function as a hint for sorting. |
© 2000 Apple Computer, Inc. (Last Updated 2/23/2000)