struct mrpt::rtti::TRuntimeClassId


A structure that holds runtime class type information.

Use CLASS_ID(<class_name>) to get a reference to the class_name’s TRuntimeClassId descriptor.

#include <mrpt/rtti/CObject.h>

struct TRuntimeClassId
    // typedefs

    typedef safe_ptr<TRuntimeClassId> Ptr;

    // fields

    const char* className;
    std::function<std::shared_ptr<CObject>void)> ptrCreateObject;
    const TRuntimeClassId*(* getBaseClass)();

    // methods

    std::shared_ptr<CObject> createObject() const;
    bool derivedFrom(const TRuntimeClassId* pBaseClass) const;
    bool derivedFrom(const char* pBaseClass_name) const;


std::function<std::shared_ptr<CObject>void)> ptrCreateObject

Create an object of the related class, or nullptr if it is virtual.

const TRuntimeClassId*(* getBaseClass)()

Gets the base class runtime id.