MRPT  2.0.3
CPropertiesValuesList.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
12 
13 namespace mrpt::hmtslam
14 {
15 /** An arbitrary list of "annotations", or named attributes, each being an
16  * instance of any CSerializable object.
17  * A multi-hypotheses version exists in CMHPropertiesValuesList.
18  * \sa CSerializable, CMHPropertiesValuesList, mrpt::system::TParameters
19  * \ingroup mrpt_base_grp
20  */
22 {
24  protected:
26  {
27  std::string name;
28  CSerializable::Ptr value;
29  };
30  /** The properties list: a map between strings and objects
31  */
32  std::vector<TPropertyValuePair> m_properties;
33 
34  public:
35  /** Default constructor
36  */
38 
39  /** Copy constructor
40  */
42 
43  /** Copy operator
44  */
46 
47  /** Destructor
48  */
49  ~CPropertiesValuesList() override;
50 
51  /** Clears the list.
52  */
53  void clear();
54 
55  /** Returns the value of the property (case insensitive), or nullptr if it
56  * does not exist.
57  */
58  CSerializable::Ptr get(const std::string& propertyName) const;
59 
60  /** Sets/change the value of the property (case insensitive), making a copy
61  * of the object (or setting it to nullptr if it is the passed value)
62  */
63  void set(const std::string& propertyName, const CSerializable::Ptr& obj);
64 
65  /** Returns the number of properties in the list
66  */
67  size_t size() const;
68 
69  /** Returns the name of all properties in the list
70  */
71  std::vector<std::string> getPropertyNames() const;
72 
73 }; // End of class def.
74 } // namespace mrpt::hmtslam
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:130
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:152
mrpt::hmtslam::CPropertiesValuesList::CPropertiesValuesList
CPropertiesValuesList()
Default constructor.
mrpt::hmtslam
Classes related to the implementation of Hybrid Metric Topological (HMT) SLAM.
Definition: CHierarchicalMapMHPartition.h:27
mrpt::serialization::CSerializable
The virtual base class which provides a unified interface for all persistent objects in MRPT.
Definition: CSerializable.h:30
mrpt::hmtslam::CPropertiesValuesList::getPropertyNames
std::vector< std::string > getPropertyNames() const
Returns the name of all properties in the list.
Definition: CPropertiesValuesList.cpp:182
mrpt::hmtslam::CPropertiesValuesList
An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable ...
Definition: CPropertiesValuesList.h:21
mrpt::hmtslam::CPropertiesValuesList::TPropertyValuePair::name
std::string name
Definition: CPropertiesValuesList.h:27
mrpt::hmtslam::CPropertiesValuesList::clear
void clear()
Clears the list.
Definition: CPropertiesValuesList.cpp:120
mrpt::hmtslam::CPropertiesValuesList::operator=
CPropertiesValuesList & operator=(const CPropertiesValuesList &o)
Copy operator.
Definition: CPropertiesValuesList.cpp:105
mrpt::hmtslam::CPropertiesValuesList::size
size_t size() const
Returns the number of properties in the list.
Definition: CPropertiesValuesList.cpp:178
CSerializable.h
mrpt::hmtslam::CPropertiesValuesList::~CPropertiesValuesList
~CPropertiesValuesList() override
Destructor.
Definition: CPropertiesValuesList.cpp:90
mrpt::hmtslam::CPropertiesValuesList::m_properties
std::vector< TPropertyValuePair > m_properties
The properties list: a map between strings and objects.
Definition: CPropertiesValuesList.h:32
mrpt::hmtslam::CPropertiesValuesList::TPropertyValuePair::value
CSerializable::Ptr value
Definition: CPropertiesValuesList.h:28
mrpt::hmtslam::CPropertiesValuesList::TPropertyValuePair
Definition: CPropertiesValuesList.h:25
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:145



Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 29 13:06:46 UTC 2020