Functions



containsObject

Abstract: A member function to query the set for the presence of a particular object.
public:

virtual bool containsObject(const OSObject *anObject) const;

Parameters

NameDescription
anObjectThe object to be located.
Result: Returns true if the object is present in the set, false otherwise.

ensureCapacity

Abstract: A member function to expand the size of the collection.
public:

virtual unsigned int ensureCapacity(unsigned int newCapacity);

Parameters

NameDescription
newCapacityThe new size capacity for the collection.
Result: Returns new capacity of the set when successful or the old capacity on failure.

flushCollection

Abstract: A member function to remove and release all items in the set.
public:

virtual void flushCollection();


free

Abstract: A member function to release and deallocate any resources used by the instance of OSOrderedSet.
public:

virtual void free();


getCapacity

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.

getCapacityIncrement

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.

getCount

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.

getFirstObject

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.

getLastObject

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.

getObject

Abstract: A member function to return a reference to an object at a particular index.
public:

virtual OSObject *getObject( unsigned int index) const;

Parameters

NameDescription
indexThe index into the set.
Result: Returns a reference to the object at the given index, 0 if none exist at that location.

getOrderingRef

Abstract: A member function to return a the ordering context.
public:

virtual void *getOrderingRef();

Result: Returns the ordering context, or NULL if none exist.

initWithCapacity

Abstract: A member function for initializing an instance of OSOrderedSet.
public:

virtual bool initWithCapacity(unsigned int capacity, OSOrderFunction orderFunc = 0, void * orderingRef = 0);

Parameters

NameDescription
capacityThe initial storage size in number of objects of the set.
orderFuncA c-style function which implements the sorting algorithm for the set.
orderingRefA 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.

isEqualTo

Abstract: A member function to test the equality between an OSOrderedSet object and the receiver.
public:

virtual bool isEqualTo(OSOrderedSet *anOrderedSet) const;

Parameters

NameDescription
anOrderedSetThe OSOrderedSet object to be compared against the receiver.
Result: Returns true if the two objects are equivalent, false otherwise.

isEqualTo

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

NameDescription
anObjectThe OSObject derived object to be compared against the receiver.
Result: Returns true if the two objects are equivalent, false otherwise.

member

Abstract: A member function to query the set for the presence of a particular object.
public:

virtual bool member(const OSObject *anObject) const;

Parameters

NameDescription
anObjectThe object to be located.
Result: Returns true if the object is present in the set, false otherwise.

orderObject

Abstract: A member function to return the ordering value of an object.
public:

virtual SInt32 orderObject( OSObject * anObject );

Parameters

NameDescription
anObjectThe object to be queried.
Result: Returns the ordering value for an object.

removeObject

Abstract: A member function to remove and release an object in the set.
public:

virtual void removeObject(OSObject *anObject);

Parameters

NameDescription
anObjectThe object to remove from the set.

setCapacityIncrement

Abstract: A member function to set the size by which the collection will grow.
public:

virtual unsigned int setCapacityIncrement(unsigned increment);

Parameters

NameDescription
incrementThe new growth factor for the set.
Result: Returns new growth size.

setFirstObject

Abstract: A member function to place an OSObject derived object order it first in the set.
public:

virtual bool setFirstObject(OSObject *anObject);

Parameters

NameDescription
anObjectThe object to be placed into the collection.
Result: Returns true if object was successfully added to the collection, false otherwise.

setLastObject

Abstract: A member function to place an OSObject derived object order it last in the set.
public:

virtual bool setLastObject(OSObject *anObject);

Parameters

NameDescription
anObjectThe object to be placed into the collection.
Result: Returns true if object was successfully added to the collection, false otherwise.

setObject

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

NameDescription
anObjectThe object to be placed into the collection.
Result: Returns true if object was successfully added to the collection, false otherwise.

setObject

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

NameDescription
indexThe index in the set to place the object.
anObjectThe object to be placed into the set.
Result: Returns true if the object was successfully placed into the collection, false otherwise.

withCapacity

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

NameDescription
capacityThe initial storage size in number of objects of the set.
orderFuncA c-style function which implements the sorting algorithm for the set.
orderingRefA ordering context used as a hint for ordering objects within the set.
Result: Returns an instance of OSSet, or 0 if a failure occurred.

© 2000 Apple Computer, Inc. — (Last Updated 2/23/2000)