Share

acrxBuildClassHierarchy

C++

ACBASE_PORT void acrxBuildClassHierarchy();

File

rxclass.h

Description

This function is used to rebuild the ObjectARX runtime class tree when new classes need to be added. It can be safely called at any time, but is necessary only after the rxInit() functions have been called for any classes to be added to the runtime tree. This is usually done inside the AcRx::kInitAppMsg case of the acrxEntryPoint() switch statement (or a function called from there). This function needs to be called only once after all the rxInit() calls have been made.

For example:

extern "C" AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
{
switch (msg) {
    case AcRx::kInitAppMsg:
        acrxDynamicLinker->unlockApplication(pkt);
        // create and fill in AcRxClass objects for
        // the custom classes
        //
        CustomClass1::rxInit();
        CustomClass2::rxInit();
        CustomClass3::rxInit();
        // Add the new classes to the runtime class tree
        //
        acrxBuildClassHierarchy();
        break;
    case AcRx::kUnloadAppMsg:
        deleteAcRxClass(CustomClass1::desc());
        deleteAcRxClass(CustomClass2::desc());
        deleteAcRxClass(CustomClass3::desc());
    }
    return AcRx::kRetOK;
}

Was this information helpful?