class mrpt::rtti::CListOfClasses

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.

#include <mrpt/rtti/CListOfClasses.h>

class CListOfClasses: public mrpt::Stringifyable
{
public:
    // typedefs

    typedef std::set<const mrpt::rtti::TRuntimeClassId*> TSet;

    //
fields

    TSet data;

    //
methods

    void insert(const mrpt::rtti::TRuntimeClassId* id);
    bool contains(const mrpt::rtti::TRuntimeClassId* id) const;
    bool containsDerivedFrom(const mrpt::rtti::TRuntimeClassId* id) const;
    virtual std::string asString() const;
    void fromString(const std::string& s);
};

Methods

void insert(const mrpt::rtti::TRuntimeClassId* id)

Insert a class in the list.

Example of usage:

myList.insert(CLASS_ID(CObservationImage));
bool contains(const mrpt::rtti::TRuntimeClassId* id) const

Does the list contains this class?

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

Does the list contains a class derived from…?

virtual std::string asString() const

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

void fromString(const std::string& s)

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

Parameters:

std::exception

On unregistered class name found.