Share

ACRX_DECLARE_MEMBERS

C++

#define ACRX_DECLARE_MEMBERS(CLASS_NAME) \
    ACRX_DECLARE_MEMBERS_EXPIMP(CLASS_NAME, ACRX_EMPTY )

File

rxboiler.h

Description

ACRX_DECLARE_MEMBERS(CLASS_NAME)

CLASS_NAME Input name of the class being declared

This macro is used in the declaration of classes that are to be a part of the ObjectARX run-time tree. The ClassName argument must be the name of the class in whose declaration the macro is included. The macro declares the member functions isA(), desc() and cast() for the class CLASS_NAME which is derived (at some level) from AcRxObject. Declaring these functions is required for the class to participate in the AcRxObject runtime type identification mechanism.

virtual AcRxClass* isA() const
static AcRxClass* gpDesc
static AcRxClass* desc()
static CLASS_NAME* cast(const AcRxObject* inPtr)
static void rxInit()

The ClassName argument should not be in quotes. If quotes are used, they will be treated as part of the actual ClassName string. Also, ClassName is case-sensitive.

Note that you don't have to declare the class member-functions isA(), desc() and cast() (that is, this macro isn't needed) if you don't need to distinguish a class at runtime any further than one of its Rx-defined base classes.

The static rxInit() function and the static gpDesc pointer, also declared by this macro, exist to allow us to implement the methods isA(), desc() and cast(). The macros ACRX_DEFINE_MEMBERS() and ACRX_xxx_DEFINE_MEMBERS() allow you to define the various functions and static variables declared with this macro.

Note

When used, this macro must be terminated by a semicolon (';') and the macro MUST BE used inside the "public" section of the class declaration. For example:

    class Foo : public AcRxObject
    {
    public:
        ACRX_DECLARE_MEMBERS(Foo);
        ...etc...
    };

Was this information helpful?