safeMetaCast
Casts an object is to the class managed by the given OSMetaClass.
Declaration
static OSMetaClassBase * safeMetaCast(
const OSMetaClassBase *anObject,
const OSMetaClass *toMeta);Parameters
- anObject:
A pointer to the object to be cast.
- toMeta:
A pointer to a constant OSMetaClass for the desired target type.
Return Value
anObject if the object is derived from the class managed by toMeta, otherwise NULL.
Overview
It is far more convenient to use OSDynamicCast.
See Also
Miscellaneous
OSCheckTypeInstOSDynamicCastOSMemberFunctionCastOSSafeReleaseOSSafeReleaseNULLOSTypeAllocOSTypeIDOSTypeIDInstcheckTypeInstgetMetaClassgetRetainCountisEqualTometaCast(const char *)metaCast(const OSMetaClass *)metaCast(const OSString *)metaCast(const OSSymbol *)release()release(int)retainserializetaggedRelease(const void *)taggedRelease(const void *, const int)taggedRetain