ADC Home > Reference Library > Reference > Darwin > Kernel Framework Reference
|
OSSet |
Inherits from: | |
Declared In: |
A collection class for storing OSMetaClassBase-derived objects.
Instances of OSSet store unique OSMetaClassBase-derived objects in a non-ordered manner.
Queries the set for the presence of the specified object.
Grows the size of the set.
Removes and releases all objects within the set.
Releases all resources created or used by the OSSet instance.
Returns an arbitrary object from the set.
Returns the storage capacity of the set.
Returns the growth factor of the set.
Returns the number of objects currently in the set.
Initializes a new instance of OSSet and populates it with the contents of the OSArray object provided.
Initializes an instance of OSSet with the specified capacity.
Initializes an instance of OSSet with the specified capacity and populates the set with the objects provided.
Initializes a new instance of OSSet and populates it with the contents of the OSSet object provided.
Tests the equality between the receiver and an unknown object.
Tests the equality between the receiver and the specified OSSet object.
Queries the set for the presence of the specified object.
Merges the contents of the specified OSArray object with the set.
Merges the contents of the specified OSSet object with receiver.
Removes objects from the set.
Archives the receiver.
Sets the growth factor of the set.
Places objects into the set.
Creates and initializes an instance of OSSet and populates it with the objects from the specified OSSArray object.
Creates and initializes an instance of OSSet with the specified capacity.
Creates and initializes an instance of OSSet and populates it with the objects provided.
Creates an instance of OSSet and populates it with the objects from the specified OSSet object.
containsObject |
Queries the set for the presence of the specified object.
public
virtual bool containsObject( const OSMetaClassBase *anObject) const;
anObject
The OSMetaClassBase-derived object to be queried for in the set.
Returns true if the object is present within the set, false otherwise.
ensureCapacity |
Grows the size of the set.
public
virtual unsigned int ensureCapacity( unsigned int newCapacity);
newCapacity
The new capacity for the set to expand to.
Returns the new capacity of the set or the previous capacity upon error.
flushCollection |
Removes and releases all objects within the set.
public
virtual void flushCollection();
free |
Releases all resources created or used by the OSSet instance.
public
virtual void free();
This function should not be called directly, use release() instead.
getAnyObject |
Returns an arbitrary object from the set.
public
virtual OSObject *getAnyObject() const;
Returns an object if one exists within the set.
getCapacity |
Returns the storage capacity of the set.
public
virtual unsigned int getCapacity() const;
Returns the storage size of the set.
getCapacityIncrement |
Returns the growth factor of the set.
public
virtual unsigned int getCapacityIncrement() const;
Returns the size by which the set will grow.
getCount |
Returns the number of objects currently in the set.
public
virtual unsigned int getCount() const;
Returns the number of objects in the set.
initWithArray |
Initializes a new instance of OSSet and populates it with the contents of the OSArray object provided.
public
virtual bool initWithArray( const OSArray *array, unsigned int capacity = 0);
array
The OSArray object containing OSMetaClassBase-derived objects used to populate the new OSSet object.
capacity
The initial storage capacity of the set. This value must be equal to or larger than the number of objects provided by the OSArray object passed as the first parameter.
Returns true if initialization is successful or false on failure.
initWithCapacity |
Initializes an instance of OSSet with the specified capacity.
public
virtual bool initWithCapacity( unsigned int capacity);
capacity
The initial storage size of the set.
Returns true if initialization is successful or false on failure.
initWithObjects |
Initializes an instance of OSSet with the specified capacity and populates the set with the objects provided.
public
virtual bool initWithObjects( const OSObject *objects[], unsigned int count, unsigned int capacity = 0);
objects
A static array containing OSMetaClassBase-derived objects used to populate the set.
count
The number of objects provided.
capacity
The initial storage size of the set. This value must be equal to or larger than the 'count' parameter.
Returns true if initialization is successful or false on failure.
initWithSet |
Initializes a new instance of OSSet and populates it with the contents of the OSSet object provided.
public
virtual bool initWithSet( const OSSet *set, unsigned int capacity = 0);
set
The OSSet object containing OSMetaClassBase derived objects used to populate the new OSSet object.
capacity
The initial storage capacity of the set. This value must be equal to or larger than the number of objects provided by the OSSet object passed as the first parameter.
Returns true if initialization is successful or false on failure.
isEqualTo(const OSMetaClassBase *) |
Tests the equality between the receiver and an unknown object.
public
virtual bool isEqualTo( const OSMetaClassBase *anObject) const;
anObject
An object to be compared against the receiver.
Returns true if the objects are equal.
isEqualTo(const OSSet *) |
Tests the equality between the receiver and the specified OSSet object.
public
virtual bool isEqualTo( const OSSet *aSet) const;
aSet
An OSSet object to be compared against the receiver.
Returns true if the objects are equivalent.
member |
Queries the set for the presence of the specified object.
public
virtual bool member( const OSMetaClassBase *anObject) const;
anObject
The OSMetaClassBase-derived object to be queried for in the set.
Returns true if the object is present within the set, false otherwise.
merge(const OSArray *) |
Merges the contents of the specified OSArray object with the set.
public
virtual bool merge( const OSArray *array);
array
The OSArray object that contains the objects to be merged.
Returns true if the contents of the OSArray were successfully merged into the receiver.
merge(const OSSet *) |
Merges the contents of the specified OSSet object with receiver.
public
virtual bool merge( const OSSet *set);
set
The OSSet object that contains the objects to be merged.
Returns true if the contents of the OSSet were successfully merged into the receiver.
removeObject |
Removes objects from the set.
public
virtual void removeObject( const OSMetaClassBase * anObject);
anObject
The OSMetaClassBase-derived object to be removed from the set.
Note that the object removed from the set is automatically released.
serialize |
Archives the receiver.
public
virtual bool serialize( OSSerialize *s) const;
s
The OSSerialize object.
Returns true if serialization was successful, false if not.
setCapacityIncrement |
Sets the growth factor of the set.
public
virtual unsigned int setCapacityIncrement( unsigned increment);
increment
The magnitude of the growth factor.
Returns the new increment.
setObject |
Places objects into the set.
public
virtual bool setObject( const OSMetaClassBase *anObject);
anObject
The OSMetaClassBase-derived object to be placed into the set.
Returns true if the object was successfully placed into the set, false otherwise.
Note that the object added to the set is automatically retained.
withArray |
Creates and initializes an instance of OSSet and populates it with the objects from the specified OSSArray object.
public
static OSSet *withArray( const OSArray *array, unsigned int capacity = 0);
array
An OSArray object containing a list of OSMetaClassBase-derived objects which are used to initially populate the OSSet object.
capacity
The initial storage size of the set. This value must be equal to or larger than the number of objects provided by the OSArray object passed as the first parameter.
Returns an instance of OSSet or 0 on failure.
withCapacity |
Creates and initializes an instance of OSSet with the specified capacity.
public
static OSSet *withCapacity( unsigned int capacity);
capacity
The initial capacity of the set. The capacity is the total number of objects that can be stored in the set.
Returns an instance of OSSet or 0 on failure.
withObjects |
Creates and initializes an instance of OSSet and populates it with the objects provided.
public
static OSSet *withObjects( const OSObject *objects[], unsigned int count, unsigned int capacity = 0);
objects
A static array of OSMetaClassBase-derived objects which are used to populate the set.
count
The number of objects passed to the set.
capacity
The initial storage size of the set. The capacity is the total number of objects that can be stored in the set. This value must be equal to or larger than the count parameter.
Returns an instance of OSSet or 0 on failure.
withSet |
Creates an instance of OSSet and populates it with the objects from the specified OSSet object.
public
static OSSet *withSet( const OSSet *set, unsigned int capacity = 0);
set
An OSSet object containing OSMetaClassBase-derived objects which are used to initially populate the new OSSet object.
capacity
The initial storage size of the set. This value must be equal to or larger than the number of objects provided by the OSSet object passed as the first parameter.
Returns an instance of OSSet or 0 on failure.
reserved |
protected
ExpansionData *reserved;
Reserved for future use. (Internal use only)
|
Last Updated: 2008-12-19