Share

AcRxObject::cast

C++

static AcRxObject * cast(
    const AcRxObject * inPtr
);

Description

This static member function provides a safe casting mechanism. If

inPtr->isKindOf(::desc()) == Adesk::kTrue

then ::cast(inPtr) returns the input pointer else ::cast(inPtr) returns NULL.

If you are certain about the class type, a regular C++ cast will do, without any CPU overhead.

This function must be defined independently in each class. Since the implementation will be the same for each class with only the class name changing, the ACRX_DECLARE_MEMBERS() macro both declares and defines this function in order make coding easier.

Parameters

Parameters Description
inPtr Input pointer to be cast to this type

Links

AcRxObject

Was this information helpful?