Functions
Abstract: A member function to query the collection for the presence of an object.
public:
virtual bool containsObject(const OSObject *anObject) const;
Parameters
Name | Description |
anObject | The OSObject derived object to be removed from the collecion. |
Result: Returns true if the object is present within the set, false otherwise.
Abstract: A member function to grow the size of the collection.
public:
virtual unsigned int ensureCapacity(unsigned int newCapacity);
Parameters
Name | Description |
newCapacity | The new capacity for the collection to expand to. |
Result: Returns the new capacity of the collecion or the previous capacity upon error.
Abstract: A member function which removes and releases all objects within the collection.
public:
virtual void flushCollection();
Abstract: A member function to release all resources created or used by the OSArray instance.
public:
virtual void free();
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.
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.
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.
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.
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
Name | Description |
array | The OSArray object contining OSObject derived objects used to populate the new OSSet object. |
capacity | The 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.
Abstract: A member function to initialize an instance of OSSet with a given capacity.
public:
virtual bool initWithCapacity(unsigned int capacity);
Parameters
Name | Description |
capacity | The initial storage size of the collection. |
Result: Returns true if initialization successful or false on failure.
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
Name | Description |
object | A static array containing OSObject derived objects used to populate the collection. |
count | The number of objects provided. |
capacity | The 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.
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
Name | Description |
array | The OSSet object contining OSObject derived objects used to populate the new OSSet object. |
capacity | The 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.
Abstract: A member function to test the equality between the receiver and an unknown object.
public:
virtual bool isEqualTo(const OSObject *anObject) const;
Parameters
Name | Description |
anObject | An object to be compared against the receiver. |
Result: Returns true if the objects are equal.
Abstract: A member function to test the equality between the receiver and an OSSet object.
public:
virtual bool isEqualTo(OSSet *aSet) const;
Parameters
Name | Description |
aSet | An OSSet object to be compared against the receiver. |
Result: Returns true if the objects are equivalent.
Abstract: A member function to query the collection for the presence of an object.
public:
virtual bool member(const OSObject *anObject) const;
Parameters
Name | Description |
anObject | The OSObject derived object to be removed from the collecion. |
Result: Returns true if the object is present within the set, false otherwise.
Abstract: A member function to merge the contents of an OSArray object with set.
public:
virtual bool merge(const OSArray *array);
Parameters
Name | Description |
array | The OSArray object which contains the objects to be merged. |
Result: Returns true if the contents of the OSArray were successfully merged into the reciever.
Abstract: A member function to merge the contents of an OSSet object with receiver.
public:
virtual bool merge(const OSSet *set);
Parameters
Name | Description |
set | The OSSet object which contains the objects to be merged. |
Result: Returns true if the contents of the OSSet were successfully merged into the reciever.
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
Name | Description |
anObject | The OSObject derived object to be removed from the collecion. |
Abstract: A member function which archives the receiver.
public:
virtual bool serialize(OSSerialize *s) const;
Parameters
Name | Description |
s | The OSSerialize object. |
Result: Returns true if serialization was successful, false if not.
Abstract: A member function which sets the growth factor of the collection.
public:
virtual unsigned int setCapacityIncrement(unsigned increment);
Result: Returns the new increment.
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
Name | Description |
anObject | The OSObject derived object to be placed into the collecion. |
Result: Returns true if the object was successfully placed into the collection, false otherwise.
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
Name | Description |
array | An OSArray object containing a list of OSObject derived objects which are used to initially populate the OSSet object. |
capacity | The 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.
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
Name | Description |
capacity | The 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.
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
Name | Description |
objects | A static array of OSObject derived objects which are used to populate the collection. |
count | The number of objects passed to the collection. |
capacity | The 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.
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
Name | Description |
array | An OSSet object containing OSObject derived objects which are used to initially populate the new OSSet object. |
capacity | The 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)