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-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 #ifndef CPropertiesValuesList_H
10 #define CPropertiesValuesList_H
11 
13 
14 namespace mrpt
15 {
16 namespace utils
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::utils::TParameters
22  * \ingroup mrpt_base_grp
23  */
25 {
27  protected:
29  {
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 } // End of namespace
78 } // End of namespace
79 
80 #endif
CPropertiesValuesList & operator=(const CPropertiesValuesList &o)
Copy operator.
std::vector< TPropertyValuePair > m_properties
The properties list: a map between strings and objects.
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:44
std::vector< std::string > getPropertyNames() const
Returns the name of all properties in the list.
GLsizei GLsizei GLuint * obj
Definition: glext.h:4070
size_t size() const
Returns the number of properties in the list.
An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable ...
GLsizei const GLchar ** string
Definition: glext.h:4101
std::shared_ptr< CSerializable > Ptr
Definition: CSerializable.h:47
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...



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019