OSMetaClassBase
OSMetaClassBase is the abstract bootstrap class for the Libkern and I/O Kit run-time type information system.
Declaration
class OSMetaClassBaseOverview
OSMetaClassBase is the abstract C++ root class underlying the entire Libkern and I/O Kit class hierarchy. It defines the run-time type information system, including dynamic class allocation and safe type-casting, as well as the abstract interface for reference counting and a few other utility functions. OSMetaClassBase is the immediate superclass of OSObject and OSMetaClass; no other class should derive from OSMetaClassBase.
For more information, see Introduction to I/O Kit Device Driver Design Guidelines.
Use by Kernel Extensions
Kernel Extensions should never interact directly with OSMetaClassBase, but they will find useful several macros that tie in to the run-time type information system, specifically:
OSTypeAlloc - allocation of new instances
OSDynamicCast - safe type casting
OSCheckTypeInst - checking for inheritance/derivation
OSMemberFunctionCast - casting C++ member functions to C function pointers for registration as callbacks
See OSMetaClass for more run-time type information interfaces.
Use Restrictions
OSMetaClassBase should not be subclassed by kernel extensions, nor should kernel extensions call its run-time type functions directly.
The run-time type functions and macros are not safe to call in a primary interrupt context.
Concurrency Protection
The run-time type macros and functions of OSMetaClassBase are thread-safe.
Topics
Miscellaneous
OSCheckTypeInstOSDynamicCastOSMemberFunctionCastOSSafeReleaseOSSafeReleaseNULLOSTypeAllocOSTypeIDOSTypeIDInstcheckTypeInstgetMetaClassgetRetainCountisEqualTometaCast(const char *)metaCast(const OSMetaClass *)metaCast(const OSString *)metaCast(const OSSymbol *)release()release(int)retainsafeMetaCastserializetaggedRelease(const void *)taggedRelease(const void *, const int)taggedRetain
Instance Methods
DispatchInvokegetMetaClassgetRetainCountisEqualTometaCastmetaCastmetaCastmetaCastoperator=releasereleaseretainserializetaggedReleasetaggedReleasetaggedRetain