struct mrpt::rtti::TRuntimeClassId

Overview

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 = nullptr;
    std::shared_ptr<CObject>(* ptrCreateObject)() = nullptr;
    const TRuntimeClassId*(* getBaseClass)() = nullptr;

    // methods

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

Fields

std::shared_ptr<CObject>(* ptrCreateObject)() = nullptr

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

const TRuntimeClassId*(* getBaseClass)() = nullptr

Gets the base class runtime id.