OSSet



Member Functions

containsObject

Abstract: A member function to query the collection for the presence of an object.
public:

virtual bool containsObject(const OSObject *anObject) const;

Parameters

NameDescription
anObjectThe OSObject derived object to be removed from the collecion.
Result: Returns true if the object is present within the set, false otherwise.

ensureCapacity

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

virtual unsigned int ensureCapacity(unsigned int newCapacity);

Parameters

NameDescription
newCapacityThe new capacity for the collection to expand to.
Result: Returns the new capacity of the collecion or the previous capacity upon error.

flushCollection

Abstract: A member function which removes and releases all objects within the collection.
public:

virtual void flushCollection();


free

Abstract: A member function to release all resources created or used by the OSArray instance.
public:

virtual void free();


getAnyObject

Abstract: A member function which returns an object from the set.
public:

virtual OSObject *getAnyObject() const;

Result: Returns an object if one exists within the set.

getCapacity

Abstract: A member function which returns the storage capacity of the collection.
public:

virtual unsigned int getCapacity() const;

Result: Returns the storage size of the collection.

getCapacityIncrement

Abstract: A member function which returns the growth factor of the collection.
public:

virtual unsigned int getCapacityIncrement() const;

Result: Returns the size by which the collection will grow.

getCount

Abstract: A member function which returns the number of objects current in the collection.
public:

virtual unsigned int getCount() const;

Result: Returns the number of objects in the collection.

initWithArray

Abstract: A member function to initialize a new instance of OSSet and populate it with the contents of the OSArray object provided.
public:

virtual bool initWithArray(const OSArray *array, unsigned int capacity = 0);

Parameters

NameDescription
arrayThe OSArray object contining OSObject derived objects used to populate the new OSSet object.
capacityThe initial storage capacity of the object. This value must be equal to or larger than the number of objects provided by the OSArray object passed as the first parameter.
Result: Returns true if initialization successful or false on failure.

initWithCapacity

Abstract: A member function to initialize an instance of OSSet with a given capacity.
public:

virtual bool initWithCapacity(unsigned int capacity);

Parameters

NameDescription
capacityThe initial storage size of the collection.
Result: Returns true if initialization successful or false on failure.

initWithObjects

Abstract: A member function to initialize an instance of OSSet with a given capacity and populate the collection with the objects provided.
public:

virtual bool initWithObjects(OSObject *objects[], unsigned int count, unsigned int capacity = 0);

Parameters

NameDescription
objectA static array containing OSObject derived objects used to populate the collection.
countThe number of objects provided.
capacityThe initial storage size of the collection. This value must be equal to or larger than the 'count' parameter.
Result: Returns true if initialization successful or false on failure.

initWithSet

Abstract: A member function to initialize a new instance of OSSet and populate it with the contents of the OSSet object provided.
public:

virtual bool initWithSet(const OSSet *set, unsigned int capacity = 0);

This function should not be called directly, use release() instead.

Parameters

NameDescription
arrayThe OSSet object contining OSObject derived objects used to populate the new OSSet object.
capacityThe initial storage capacity of the object. This value must be equal to or larger than the number of objects provided by the OSSet object passed as the first parameter.
Result: Returns true if initialization successful or false on failure.

isEqualTo

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

virtual bool isEqualTo(const OSObject *anObject) const;

Parameters

NameDescription
anObjectAn object to be compared against the receiver.
Result: Returns true if the objects are equal.

isEqualTo

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

virtual bool isEqualTo(OSSet *aSet) const;

Parameters

NameDescription
aSetAn OSSet object to be compared against the receiver.
Result: Returns true if the objects are equivalent.

member

Abstract: A member function to query the collection for the presence of an object.
public:

virtual bool member(const OSObject *anObject) const;

Parameters

NameDescription
anObjectThe OSObject derived object to be removed from the collecion.
Result: Returns true if the object is present within the set, false otherwise.

merge

Abstract: A member function to merge the contents of an OSArray object with set.
public:

virtual bool merge(const OSArray *array);

Parameters

NameDescription
arrayThe OSArray object which contains the objects to be merged.
Result: Returns true if the contents of the OSArray were successfully merged into the reciever.

merge

Abstract: A member function to merge the contents of an OSSet object with receiver.
public:

virtual bool merge(const OSSet *set);

Parameters

NameDescription
setThe OSSet object which contains the objects to be merged.
Result: Returns true if the contents of the OSSet were successfully merged into the reciever.

removeObject

Abstract: A member function to remove objects from the collection.
public:

virtual void removeObject(OSObject * anObject);

The object removed from the collecion is automatically released.

Parameters

NameDescription
anObjectThe OSObject derived object to be removed from the collecion.

serialize

Abstract: A member function which archives the receiver.
public:

virtual bool serialize(OSSerialize *s) const;

Parameters

NameDescription
sThe OSSerialize object.
Result: Returns true if serialization was successful, false if not.

setCapacityIncrement

Abstract: A member function which sets the growth factor of the collection.
public:

virtual unsigned int setCapacityIncrement(unsigned increment);

Result: Returns the new increment.

setObject

Abstract: A member function to place objects into the collection.
public:

virtual bool setObject(OSObject *anObject);

The object added to the collecion is automatically retained.

Parameters

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

withArray

Abstract: A static constructor function to create and initialize an instance of OSSet and populate it with the objects from an OSSArray obeject.
public:

static OSSet *withArray(const OSArray *array, unsigned int capacity = 0);

Parameters

NameDescription
arrayAn OSArray object containing a list of OSObject derived objects which are used to initially populate the OSSet object.
capacityThe initial storage size of the collection. This value must be equal to or larger than the number of objects provided by the OSArray object passed as the first parameter.
Result: Returns an instance of OSSet or 0 on failure.

withCapacity

Abstract: A static constructor function to create and initialize an instance of OSSet with a given capacity.
public:

static OSSet *withCapacity(unsigned int capacity);

Parameters

NameDescription
capacityThe initial capacity of the collection. The capacity is the total number of objects that can be stored in the collection.
Result: Returns an instance of OSSet or 0 on failure.

withObjects

Abstract: A static constructor function to create and initialize an instance of OSSet and populate it with the objects provied.
public:

static OSSet *withObjects(OSObject *objects[], unsigned int count, unsigned int capacity = 0);

Parameters

NameDescription
objectsA static array of OSObject derived objects which are used to populate the collection.
countThe number of objects passed to the collection.
capacityThe initial storage size of the collection. The capacity is the total number of objects that can be stored in the collection. This value must be equal to or larger than the count parameter.
Result: Returns an instance of OSSet or 0 on failure.

withSet

Abstract: A static constructor function to create an instance of OSSet and populate it with the objects from another OSSet obeject.
public:

static OSSet *withSet(const OSSet *set, unsigned int capacity = 0);

Parameters

NameDescription
arrayAn OSSet object containing OSObject derived objects which are used to initially populate the new OSSet object.
capacityThe initial storage size of the collection. This value must be equal to or larger than the number of objects provided by the OSSet object passed as the first parameter.
Result: Returns an instance of OSSet or 0 on failure.

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