23 for (
const auto& i :
data)
24 if (i->derivedFrom(
id))
return true;
32 for (
const auto& i :
data)
34 if (cnt++ != 0) s +=
", ";
35 s += std::string(i->className);
41 static inline std::string&
ltrim(std::string& s)
43 s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](
const char c) {
44 return !std::isspace(c);
50 static inline std::string&
rtrim(std::string& s)
54 s.rbegin(), s.rend(), [](
const char c) {
return !std::isspace(c); })
67 std::stringstream ss(s);
69 while (std::getline(ss, lin,
','))
74 id !=
nullptr,
format(
"Unknown class name: %s", lin.c_str()));
#define MRPT_TRY_END
The end of a standard MRPT "try...catch()" block that allows tracing throw the call stack after an ex...
std::string std::string format(std::string_view fmt, ARGS &&... args)
A structure that holds runtime class type information.
void insert(const mrpt::rtti::TRuntimeClassId *id)
Insert a class in the list.
#define MRPT_TRY_START
The start of a standard MRPT "try...catch()" block that allows tracing throw the call stack after an ...
static std::string & ltrim(std::string &s)
static std::string & trim(std::string &s)
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.
static std::string & rtrim(std::string &s)
bool containsDerivedFrom(const mrpt::rtti::TRuntimeClassId *id) const
Does the list contains a class derived from...?
void fromString(const std::string &s)
Builds from a string representation of the list, for example: "CPose2D, CObservation, CPose3D".
std::string toString() const
Return a string representation of the list, for example: "CPose2D, CObservation, CPose3D".