Main MRPT website > C++ reference for MRPT 1.5.6
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  // This must be added to any CSerializable derived class:
20 
21  /** An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable object.
22  * A multi-hypotheses version exists in CMHPropertiesValuesList.
23  * \sa CSerializable, CMHPropertiesValuesList, mrpt::utils::TParameters
24  * \ingroup mrpt_base_grp
25  */
27  {
28  // This must be added to any CSerializable derived class:
30  protected:
32  {
34  CSerializablePtr value;
35  };
36  /** The properties list: a map between strings and objects
37  */
38  std::vector<TPropertyValuePair> m_properties;
39 
40  public:
41  /** Default constructor
42  */
44 
45  /** Copy constructor
46  */
48 
49  /** Copy operator
50  */
51  CPropertiesValuesList& operator = (const CPropertiesValuesList &o);
52 
53  /** Destructor
54  */
55  virtual ~CPropertiesValuesList();
56 
57  /** Clears the list.
58  */
59  void clear();
60 
61  /** Returns the value of the property (case insensitive), or NULL if it does not exist.
62  */
63  CSerializablePtr get(const std::string &propertyName) const;
64 
65  /** Sets/change the value of the property (case insensitive), making a copy of the object (or setting it to NULL if it is the passed value)
66  */
67  void set(const std::string &propertyName,const CSerializablePtr &obj);
68 
69  /** Returns the number of properties in the list
70  */
71  size_t size() const;
72 
73  /** Returns the name of all properties in the list
74  */
75  std::vector<std::string> getPropertyNames() const;
76 
77  }; // End of class def.
79 
80 
81  } // End of namespace
82 } // End of namespace
83 
84 #endif
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:39
GLsizei GLsizei GLuint * obj
Definition: glext.h:3902
void clear()
Clear the contents of this container.
Definition: ts_hash_map.h:113
An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable ...
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE(class_name, base_name)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
GLsizei const GLchar ** string
Definition: glext.h:3919
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...
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE(class_name, base_name)
GLsizeiptr size
Definition: glext.h:3779



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