29 if (pBaseClass ==
this)
return true;
36 while (pClassThis !=
nullptr)
38 if (pClassThis == pBaseClass)
return true;
57 pBaseClass !=
nullptr,
58 format(
"Class %s not registered??", pBaseClass_name));
61 if (pBaseClass ==
this)
return true;
65 while (pClassThis !=
nullptr)
67 if (pClassThis == pBaseClass)
return true;
85 "[TRuntimeClassId::createObject] Trying to create an object " 86 "without dynamic constructor. classname=`%s`\n",
95 catch (std::bad_alloc&)
111 if (!pR)
return nullptr;
112 return pR->createObject();
std::shared_ptr< CObject > createObject() const
void registerAllPendingClasses()
Register all pending classes - to be called just before de-serializing an object, for example...
std::string std::string format(std::string_view fmt, ARGS &&... args)
A structure that holds runtime class type information.
const TRuntimeClassId *(* getBaseClass)()
Gets the base class runtime id.
Virtual base to provide a compiler-independent RTTI system.
#define ASSERT_(f)
Defines an assertion mechanism.
std::function< std::shared_ptr< CObject >void)> ptrCreateObject
Create an object of the related class, or nullptr if it is virtual.
const TRuntimeClassId * findRegisteredClass(const std::string &className, const bool allow_ignore_namespace=true)
Return info about a given class by its name, or nullptr if the class is not registered.
#define ASSERTMSG_(f, __ERROR_MSG)
Defines an assertion mechanism.
int fprintf(FILE *fil, const char *format,...) noexcept MRPT_printf_format_check(2
An OS-independent version of fprintf.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
static const mrpt::rtti::TRuntimeClassId & GetRuntimeClassIdStatic()
static mrpt::rtti::TRuntimeClassId * _GetBaseClass()
mrpt::rtti::CObject::Ptr classFactory(const std::string &className)
Creates an object given by its registered name.
bool derivedFrom(const TRuntimeClassId *pBaseClass) const
static const mrpt::rtti::TRuntimeClassId runtimeClassId
std::shared_ptr< CObject > Ptr