Main MRPT website > C++ reference for MRPT 1.9.9
CPropertiesValuesList.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, 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 #ifndef CPropertiesValuesList_H
10 #define CPropertiesValuesList_H
11 
13 
14 namespace mrpt
15 {
16 namespace hmtslam
17 {
18 /** An arbitrary list of "annotations", or named attributes, each being an
19  * instance of any CSerializable object.
20  * A multi-hypotheses version exists in CMHPropertiesValuesList.
21  * \sa CSerializable, CMHPropertiesValuesList, mrpt::system::TParameters
22  * \ingroup mrpt_base_grp
23  */
25 {
27  protected:
29  {
31  CSerializable::Ptr value;
32  };
33  /** The properties list: a map between strings and objects
34  */
35  std::vector<TPropertyValuePair> m_properties;
36 
37  public:
38  /** Default constructor
39  */
41 
42  /** Copy constructor
43  */
45 
46  /** Copy operator
47  */
49 
50  /** Destructor
51  */
52  virtual ~CPropertiesValuesList();
53 
54  /** Clears the list.
55  */
56  void clear();
57 
58  /** Returns the value of the property (case insensitive), or nullptr if it
59  * does not exist.
60  */
61  CSerializable::Ptr get(const std::string& propertyName) const;
62 
63  /** Sets/change the value of the property (case insensitive), making a copy
64  * of the object (or setting it to nullptr if it is the passed value)
65  */
66  void set(const std::string& propertyName, const CSerializable::Ptr& obj);
67 
68  /** Returns the number of properties in the list
69  */
70  size_t size() const;
71 
72  /** Returns the name of all properties in the list
73  */
74  std::vector<std::string> getPropertyNames() const;
75 
76 }; // End of class def.
77 } // namespace hmtslam
78 } // namespace mrpt
79 
80 #endif
std::vector< std::string > getPropertyNames() const
Returns the name of all properties in the list.
GLsizei GLsizei GLuint * obj
Definition: glext.h:4070
GLsizei const GLchar ** string
Definition: glext.h:4101
std::vector< TPropertyValuePair > m_properties
The properties list: a map between strings and objects.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
size_t size() const
Returns the number of properties in the list.
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:32
CPropertiesValuesList & operator=(const CPropertiesValuesList &o)
Copy operator.
An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable ...



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019