Main MRPT website > C++ reference for MRPT 1.5.6
CListOfClasses.cpp
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 #include "base-precomp.h" // Precompiled headers
10 
12 
13 using namespace mrpt;
14 using namespace mrpt::utils;
15 
16 
18 {
19  for (const_iterator it=begin();it!=end();++it)
20  if ( (*it)->derivedFrom(id) )
21  return true;
22  return false;
23 }
24 
26 {
27  std::string s;
28  for (const_iterator it=begin();it!=end();++it)
29  {
30  if (it!=begin()) s+=", ";
31  s+=std::string( (*it)->className );
32  }
33  return s;
34 }
35 
37 {
39 
40  this->clear();
41  std::vector<std::string> lstClasses;
43 
44  for (size_t i=0;i<lstClasses.size();i++)
45  {
47  ASSERTMSG_(id!=NULL, format("Unknown class name: %s",lstClasses[i].c_str()))
48  this->insert(id);
49  }
50 
52 }
53 
void insert(const mrpt::utils::TRuntimeClassId *id)
Insert a class in the list.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Definition: zip.h:16
bool containsDerivedFrom(const mrpt::utils::TRuntimeClassId *id) const
Does the list contains a class derived from...?
std::string toString() const
Return a string representation of the list, for example: "CPose2D, CObservation, CPose3D".
void clear()
Empty the list.
GLdouble s
Definition: glext.h:3602
TSet::const_iterator const_iterator
const mrpt::utils::TRuntimeClassId * lstClasses[]
#define MRPT_TRY_END
const TRuntimeClassId BASE_IMPEXP * findRegisteredClass(const std::string &className)
Return info about a given class by its name, or NULL if the class is not registered.
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
Definition: format.cpp:21
GLsizei const GLchar ** string
Definition: glext.h:3919
void fromString(const std::string &s)
Return a string representation of the list, for example: "CPose2D, CObservation, CPose3D".
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define MRPT_TRY_START
A structure that holds runtime class type information.
Definition: CObject.h:46
#define ASSERTMSG_(f, __ERROR_MSG)
void BASE_IMPEXP tokenize(const std::string &inString, const std::string &inDelimiters, std::deque< std::string > &outTokens, bool skipBlankTokens=true) MRPT_NO_THROWS
Tokenizes a string according to a set of delimiting characters.



Page generated by Doxygen 1.8.14 for MRPT 1.5.6 Git: 4c65e8431 Tue Apr 24 08:18:17 2018 +0200 at lun oct 28 01:35:26 CET 2019