Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Public Types | Public Member Functions | Public Attributes
mrpt::rtti::CListOfClasses Class Reference

Detailed Description

A list (actually based on a std::set) of MRPT classes, capable of keeping any class registered by the mechanism of CObject classes.

Access to "data" for the actual content, or use any of the helper methods in this class.

Definition at line 24 of file CListOfClasses.h.

#include <mrpt/rtti/CListOfClasses.h>

Public Types

using TSet = std::set< const mrpt::rtti::TRuntimeClassId * >
 

Public Member Functions

void insert (const mrpt::rtti::TRuntimeClassId *id)
 Insert a class in the list. More...
 
bool contains (const mrpt::rtti::TRuntimeClassId *id) const
 Does the list contains this class? More...
 
bool containsDerivedFrom (const mrpt::rtti::TRuntimeClassId *id) const
 Does the list contains a class derived from...? More...
 
std::string toString () const
 Return a string representation of the list, for example: "CPose2D, CObservation, CPose3D". More...
 
void fromString (const std::string &s)
 Builds from a string representation of the list, for example: "CPose2D, CObservation, CPose3D". More...
 

Public Attributes

TSet data
 

Member Typedef Documentation

◆ TSet

Definition at line 27 of file CListOfClasses.h.

Member Function Documentation

◆ contains()

bool mrpt::rtti::CListOfClasses::contains ( const mrpt::rtti::TRuntimeClassId id) const
inline

Does the list contains this class?

Definition at line 41 of file CListOfClasses.h.

Referenced by mrpt::slam::CMetricMapBuilderICP::processObservation().

◆ containsDerivedFrom()

bool CListOfClasses::containsDerivedFrom ( const mrpt::rtti::TRuntimeClassId id) const

Does the list contains a class derived from...?

Definition at line 20 of file CListOfClasses.cpp.

◆ fromString()

void CListOfClasses::fromString ( const std::string s)

Builds from a string representation of the list, for example: "CPose2D, CObservation, CPose3D".

Exceptions
std::exceptionOn unregistered class name found.

Definition at line 62 of file CListOfClasses.cpp.

References ASSERTMSG_, mrpt::rtti::findRegisteredClass(), mrpt::format(), insert(), MRPT_TRY_END, MRPT_TRY_START, and trim().

◆ insert()

void mrpt::rtti::CListOfClasses::insert ( const mrpt::rtti::TRuntimeClassId id)
inline

Insert a class in the list.

Example of usage:

myList.insert(CLASS_ID(CObservationImage));

Definition at line 35 of file CListOfClasses.h.

Referenced by fromString().

◆ toString()

std::string CListOfClasses::toString ( ) const

Return a string representation of the list, for example: "CPose2D, CObservation, CPose3D".

Definition at line 28 of file CListOfClasses.cpp.

Member Data Documentation

◆ data

TSet mrpt::rtti::CListOfClasses::data
CLASS_ID
#define CLASS_ID(T)
Access to runtime class ID for a defined class name.
Definition: CObject.h:85



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST