Main MRPT website > C++ reference for MRPT 1.3.2
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-2015, 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 /*---------------------------------------------------------------
15  Class
16  ---------------------------------------------------------------*/
17 namespace mrpt
18 {
19  namespace utils
20  {
21  // This must be added to any CSerializable derived class:
23 
24  /** An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable object.
25  * A multi-hypotheses version exists in CMHPropertiesValuesList.
26  * \sa CSerializable, CMHPropertiesValuesList, mrpt::utils::TParameters
27  * \ingroup mrpt_base_grp
28  */
30  {
31  // This must be added to any CSerializable derived class:
33  protected:
35  {
36  std::string name;
38  };
39  /** The properties list: a map between strings and objects
40  */
41  std::vector<TPropertyValuePair> m_properties;
42 
43  public:
44  /** Default constructor
45  */
47 
48  /** Copy constructor
49  */
51 
52  /** Copy operator
53  */
54  CPropertiesValuesList& operator = (const CPropertiesValuesList &o);
55 
56  /** Destructor
57  */
58  virtual ~CPropertiesValuesList();
59 
60  /** Clears the list.
61  */
62  void clear();
63 
64  /** Returns the value of the property (case insensitive), or NULL if it does not exist.
65  */
66  CSerializablePtr get(const std::string &propertyName) const;
67 
68  /** 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)
69  */
70  void set(const std::string &propertyName,const CSerializablePtr &obj);
71 
72  /** Returns the number of properties in the list
73  */
74  size_t size() const;
75 
76  /** Returns the name of all properties in the list
77  */
78  std::vector<std::string> getPropertyNames() const;
79 
80  }; // End of class def.
82 
83 
84  } // End of namespace
85 } // End of namespace
86 
87 #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
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...
struct BASE_IMPEXP CSerializablePtr
Definition: CStream.h:24
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 MATRIXLIKE &m, int dim)
Definition: bits.h:38
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE(class_name, base_name)



Page generated by Doxygen 1.8.12 for MRPT 1.3.2 SVN: at Thu Nov 10 13:46:27 UTC 2016