OSSet
OSSet provides an unordered set store of objects.
Declaration
class OSSet : OSArrayclass OSSet : OSCollectionOverview
OSSet is a container for Libkern C++ objects (those derived from OSMetaClassBase, in particular OSObject). Storage and access follow basic set logic: you can add or remove an object, and test whether the set contains a particular object. A given object is only stored in the set once, and there is no ordering of objects in the set. A subclass OSOrderedSet, provides for ordered set logic.
As with all Libkern collection classes, OSSet retains objects added to it, and releases objects removed from it. An OSSet also grows as necessary to accommodate new objects, unlike Core Foundation collections (it does not, however, shrink).
Use Restrictions
With very few exceptions in the I/O Kit, all Libkern-based C++ classes, functions, and macros are unsafe to use in a primary interrupt context. Consult the I/O Kit documentation related to primary interrupts for more information.
OSSet provides no concurrency protection; it's up to the usage context to provide any protection necessary. Some portions of the I/O Kit, such as IORegistryEntry, handle synchronization via defined member functions for setting properties.
Topics
Miscellaneous
containsObjectcopyCollectionensureCapacityflushCollectionfreegetAnyObjectgetCapacitygetCapacityIncrementgetCountinitWithArrayinitWithCapacityinitWithObjectsinitWithSetisEqualTo(const OSMetaClassBase *)isEqualTo(const OSSet *)membermerge(const OSArray *)merge(const OSSet *)removeObjectserializesetCapacityIncrementsetObjectwithArraywithCapacitywithObjectswithSet
Instance Methods
containsObjectcopyCollectionensureCapacityflushCollectionfreegetAnyObjectgetCapacitygetCapacityIncrementgetCountgetMetaClassgetNextObjectForIteratorinitinitIteratorinitWithArrayinitWithCapacityinitWithObjectsinitWithSetisEqualToisEqualToiteratorSizemembermergemergeremoveObjectremoveObjectserializesetCapacityIncrementsetObjectsetObjectsetOptions