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
mrpt::hmtslam::CPropertiesValuesList::get
CSerializable::Ptr get(const std::string &propertyName) const
Returns the value of the property (case insensitive), or nullptr if it does not exist.
Definition: CPropertiesValuesList.cpp:132
obj
GLsizei GLsizei GLuint * obj
Definition: glext.h:4070
mrpt::hmtslam::CPropertiesValuesList::~CPropertiesValuesList
virtual ~CPropertiesValuesList()
Destructor.
Definition: CPropertiesValuesList.cpp:92
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::hmtslam::CPropertiesValuesList::CPropertiesValuesList
CPropertiesValuesList()
Default constructor.
Definition: CPropertiesValuesList.cpp:88
mrpt::serialization::CSerializable
The virtual base class which provides a unified interface for all persistent objects in MRPT.
Definition: CSerializable.h:32
mrpt::hmtslam::CPropertiesValuesList::getPropertyNames
std::vector< std::string > getPropertyNames() const
Returns the name of all properties in the list.
Definition: CPropertiesValuesList.cpp:187
mrpt::hmtslam::CPropertiesValuesList
An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable ...
Definition: CPropertiesValuesList.h:24
mrpt::hmtslam::CPropertiesValuesList::TPropertyValuePair::name
std::string name
Definition: CPropertiesValuesList.h:30
mrpt::hmtslam::CPropertiesValuesList::clear
void clear()
Clears the list.
Definition: CPropertiesValuesList.cpp:122
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:102
mrpt::hmtslam::CPropertiesValuesList::operator=
CPropertiesValuesList & operator=(const CPropertiesValuesList &o)
Copy operator.
Definition: CPropertiesValuesList.cpp:107
string
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::hmtslam::CPropertiesValuesList::size
size_t size() const
Returns the number of properties in the list.
Definition: CPropertiesValuesList.cpp:183
CSerializable.h
mrpt::hmtslam::CPropertiesValuesList::m_properties
std::vector< TPropertyValuePair > m_properties
The properties list: a map between strings and objects.
Definition: CPropertiesValuesList.h:35
mrpt::hmtslam::CPropertiesValuesList::TPropertyValuePair::value
CSerializable::Ptr value
Definition: CPropertiesValuesList.h:31
mrpt::hmtslam::CPropertiesValuesList::TPropertyValuePair
Definition: CPropertiesValuesList.h:28
mrpt::hmtslam::CPropertiesValuesList::set
void set(const std::string &propertyName, const CSerializable::Ptr &obj)
Sets/change the value of the property (case insensitive), making a copy of the object (or setting it ...
Definition: CPropertiesValuesList.cpp:149



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST