ADC Home > Reference Library > Reference > Darwin > Kernel Framework Reference
|
OSOrderedSet |
Inherits from: | |
Declared In: |
A collection class for maintaining and sorting a set of OSMetaClassBase-derived objects.
An instance of OSOrderedSet maintains and sorts a collection of OSMetaClassBase-derived objects. The sorting algorithm is supplied to the instance via the OSOrderFunction.
Queries the set for the presence of the specified object.
Expands the size of the collection.
Removes and releases all items in the set.
Releases and deallocates any resources used by the instance of OSOrderedSet.
Returns the storage capacity of the collection.
Gets the size by which the collection will grow.
Returns the number of objects within the collection.
Returns the first object in the set.
Returns the last object in the set.
Returns a reference to an object at the specified index.
Returns the ordering context.
Initializes an instance of OSOrderedSet.
Tests the equality between an arbitrary OSMetaClassBase-derived object and the receiver.
Tests the equality between an OSOrderedSet object and the receiver.
Queries the set for the presence of the specified object.
Returns the ordering value of the specified object.
Removes and releases an object in the set.
Sets the size by which the collection will grow.
Places an OSMetaClassBase-derived object into the first position in the set.
Places an OSMetaClassBase-derived object into the last position in the set.
Places an OSMetaClassBase-derived object into the set.
Places the specified object into the set at the specified index.
Creates and initializes an instance of OSOrderedSet.
containsObject |
Queries the set for the presence of the specified object.
public
virtual bool containsObject( const OSMetaClassBase *anObject) const;
anObject
The object to be located.
Returns true if the object is present in the set, false otherwise.
ensureCapacity |
Expands the size of the collection.
public
virtual unsigned int ensureCapacity( unsigned int newCapacity);
newCapacity
The new size capacity for the collection.
Returns the new capacity of the set when successful or the old capacity on failure.
flushCollection |
Removes and releases all items in the set.
public
virtual void flushCollection();
free |
Releases and deallocates any resources used by the instance of OSOrderedSet.
public
virtual void free();
getCapacity |
Returns the storage capacity of the collection.
public
virtual unsigned int getCapacity() const;
Returns the total storage capacity of the set.
getCapacityIncrement |
Gets the size by which the collection will grow.
public
virtual unsigned int getCapacityIncrement() const;
Returns the current growth size.
getCount |
Returns the number of objects within the collection.
public
virtual unsigned int getCount() const;
Returns the number of items in the set.
getFirstObject |
Returns the first object in the set.
public
virtual OSObject *getFirstObject() const;
Returns the object ordered first in the set or 0 if none exist.
getLastObject |
Returns the last object in the set.
public
virtual OSObject *getLastObject() const;
Returns the object ordered last in the set or 0 if none exist.
getObject |
Returns a reference to an object at the specified index.
public
virtual OSObject *getObject( unsigned int index) const;
index
The index into the set.
Returns a reference to the object at the given index, 0 if none exist at that location.
getOrderingRef |
Returns the ordering context.
public
virtual void *getOrderingRef();
Returns the ordering context, or NULL if none exist.
initWithCapacity |
Initializes an instance of OSOrderedSet.
public
virtual bool initWithCapacity( unsigned int capacity, OSOrderFunction orderFunc = 0, void *orderingRef = 0);
capacity
The initial storage size in number of objects of the set.
orderFunc
A C-style function that implements the sorting algorithm for the set.
orderingRef
An ordering context used as a hint for ordering objects within the set.
Returns true if initialization was successful, or false if a failure occurred.
isEqualTo(const OSMetaClassBase *) |
Tests the equality between an arbitrary OSMetaClassBase-derived object and the receiver.
public
virtual bool isEqualTo( const OSMetaClassBase *anObject) const;
anObject
The OSMetaClassBase-derived object to be compared against the receiver.
Returns true if the two objects are equivalent, false otherwise.
isEqualTo(const OSOrderedSet *) |
Tests the equality between an OSOrderedSet object and the receiver.
public
virtual bool isEqualTo( const OSOrderedSet *anOrderedSet) const;
anOrderedSet
The OSOrderedSet object to be compared against the receiver.
Returns true if the two objects are equivalent, false otherwise.
member |
Queries the set for the presence of the specified object.
public
virtual bool member( const OSMetaClassBase *anObject) const;
anObject
The object to be located.
Returns true if the object is present in the set, false otherwise.
orderObject |
Returns the ordering value of the specified object.
public
virtual SInt32 orderObject( const OSMetaClassBase * anObject );
anObject
The object to be queried.
Returns the ordering value for an object.
removeObject |
Removes and releases an object in the set.
public
virtual void removeObject( const OSMetaClassBase *anObject);
anObject
The object to remove from the set.
setCapacityIncrement |
Sets the size by which the collection will grow.
public
virtual unsigned int setCapacityIncrement( unsigned increment);
increment
The new growth factor for the set.
Returns the new growth size.
setFirstObject |
Places an OSMetaClassBase-derived object into the first position in the set.
public
virtual bool setFirstObject( const OSMetaClassBase *anObject);
anObject
The object to be placed into the collection.
Returns true if the object was successfully added to the collection, false otherwise.
setLastObject |
Places an OSMetaClassBase-derived object into the last position in the set.
public
virtual bool setLastObject( const OSMetaClassBase *anObject);
anObject
The object to be placed into the collection.
Returns true if the object was successfully added to the collection, false otherwise.
setObject(const OSMetaClassBase *) |
Places an OSMetaClassBase-derived object into the set.
public
virtual bool setObject( const OSMetaClassBase *anObject);
anObject
The object to be placed into the collection.
Returns true if the object was successfully added to the collection, false otherwise.
Note that the object will be automatically sorted in the set.
setObject(unsigned int, const OSMetaClassBase *) |
Places the specified object into the set at the specified index.
public
virtual bool setObject( unsigned int index, const OSMetaClassBase *anObject);
index
The index in the set to place the object.
anObject
The object to be placed into the set.
Returns true if the object was successfully placed into the collection, false otherwise.
withCapacity |
Creates and initializes an instance of OSOrderedSet.
public
static OSOrderedSet *withCapacity( unsigned int capacity, OSOrderFunction orderFunc = 0, void *orderingRef = 0);
capacity
The initial storage size in number of objects of the set.
orderFunc
A C-style function that implements the sorting algorithm for the set.
orderingRef
An ordering context used as a hint for ordering objects within the set.
Returns an instance of OSOrderedSet, or 0 if a failure occurred.
OSOrderFunction |
The sorting function used by the collection to order objects.
public
typedef SInt32 ( *OSOrderFunction)( const OSMetaClassBase * obj1, const OSMetaClassBase * obj2, void * ref );
obj1
An object from the collection.
obj2
An object to be compared to obj1.
ref
The ordering context used by the sorting function as a hint for sorting.
Returns a comparison result of the object, a negative value if obj1 > obj2, 0 if obj1 == obj2, and a positive value if obj1
reserved |
protected
ExpansionData *reserved;
Reserved for future use. (Internal use only)
|
Last Updated: 2008-12-19