MRPT  2.0.0
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
std::vector< std::string > getPropertyNames() const
Returns the name of all properties in the list.
Classes related to the implementation of Hybrid Metric Topological (HMT) SLAM.
std::vector< TPropertyValuePair > m_properties
The properties list: a map between strings and objects.
size_t size() const
Returns the number of properties in the list.
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:30
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
CPropertiesValuesList()
Default constructor.
CPropertiesValuesList & operator=(const CPropertiesValuesList &o)
Copy operator.
An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable ...



Page generated by Doxygen 1.8.14 for MRPT 2.0.0 Git: b38439d21 Tue Mar 31 19:58:06 2020 +0200 at miƩ abr 1 00:50:30 CEST 2020