ensureCapacity
Ensures the set has enough space to store the requested number of distinct objects.
Declaration
virtual unsigned int ensureCapacity(
unsigned intnewCapacity);Parameters
- newCapacity:
The total number of distinct objects the ordered set should be able to store.
Return Value
The new capacity of the ordered set, which may be different from the number requested (if smaller, reallocation of storage failed).
Overview
This function immediately resizes the ordered set, if necessary, to accommodate at least newCapacity distinct objects. If newCapacity is not greater than the current capacity, or if an allocation error occurs, the original capacity is returned.
There is no way to reduce the capacity of an OSOrderedSet.
See Also
Miscellaneous
containsObjectcopyCollectionflushCollectionfreegetCapacitygetCapacityIncrementgetCountgetFirstObjectgetLastObjectgetObjectgetOrderingRefinitWithCapacityisEqualTo(const OSMetaClassBase *)isEqualTo(const OSOrderedSet *)memberorderObjectremoveObjectsetCapacityIncrementsetFirstObjectsetLastObjectsetObject(const OSMetaClassBase *)setObject(unsigned int, const OSMetaClassBase *)withCapacity