Go to the documentation of this file.
31 for (i = 0; i <
n; i++)
34 out << m_properties[i].name.c_str();
37 isNull = !m_properties[i].value;
40 if (!isNull) out << *m_properties[i].value;
43 out << m_properties[i].ID;
62 m_properties.resize(
n);
63 for (i = 0; i <
n; i++)
68 m_properties[i].name = nameBuf;
74 m_properties[i].value.reset();
76 in >> m_properties[i].value;
79 in >> m_properties[i].ID;
102 m_properties.clear();
110 const char* propertyName,
const int64_t& hypothesis_ID)
const
113 for (it = m_properties.begin(); it != m_properties.end(); ++it)
115 it->ID == hypothesis_ID)
118 for (it = m_properties.begin(); it != m_properties.end(); ++it)
119 if (!
os::_strcmpi(propertyName, it->name.c_str()) && it->ID == 0)
130 const char* propertyName)
const
133 m_properties.begin();
134 it != m_properties.end(); ++it)
136 if (!
os::_strcmpi(propertyName, it->name.c_str()))
return it->value;
152 m_properties.begin();
153 it != m_properties.end(); ++it)
155 if (it->ID == hypothesis_ID &&
172 newPair.
ID = hypothesis_ID;
173 m_properties.push_back(newPair);
176 printf(
"Exception while setting annotation '%s'", propertyName););
189 m_properties.begin();
190 it != m_properties.end(); ++it)
192 if (it->ID == hypothesis_ID &&
205 newPair.
ID = hypothesis_ID;
206 m_properties.push_back(newPair);
209 printf(
"Exception while setting annotation '%s'", propertyName););
217 std::vector<std::string> ret;
220 m_properties.begin();
221 it != m_properties.end(); ++it)
225 itS != ret.end(); ++itS)
227 if ((*itS) == it->name)
233 if (isNew) ret.push_back(it->name);
243 const char* propertyName,
const int64_t& hypothesis_ID)
246 m_properties.begin();
247 it != m_properties.end();)
249 it->ID == hypothesis_ID)
250 it = m_properties.erase(it);
261 m_properties.begin();
262 it != m_properties.end();)
263 if (it->ID == hypothesis_ID)
264 it = m_properties.erase(it);
274 : m_properties(o.m_properties)
279 it->value.reset(
dynamic_cast<CSerializable*
>(it->value->clone()));
288 if (
this == &o)
return *
this;
295 it->value.reset(
dynamic_cast<CSerializable*
>(it->value->clone()));
void clear()
Clear the contents of this container.
const Scalar * const_iterator
std::shared_ptr< CSerializable > Ptr
void setMemoryReference(const char *propertyName, const CSerializable::Ptr &obj, const int64_t &hypothesis_ID)
Sets/change the value of the property (case insensitive) for the given hypothesis ID,...
#define MRPT_END_WITH_CLEAN_UP(stuff)
GLsizei GLsizei GLuint * obj
virtual ~CMHPropertiesValuesList()
Destructor.
void removeAll(const int64_t &hypothesis_ID)
Remove all the properties for the given hypothesis.
void remove(const char *propertyName, const int64_t &hypothesis_ID)
Remove a given property, if it exists.
void clear()
Clears the list and frees all object's memory.
mrpt::serialization::CSerializable::Ptr value
Virtual base class for "archives": classes abstracting I/O streams.
CSerializable::Ptr getAnyHypothesis(const char *propertyName) const
Returns the value of the property (case insensitive) for the first hypothesis ID found,...
Classes related to the implementation of Hybrid Metric Topological (HMT) SLAM.
std::vector< std::string > getPropertyNames() const
Returns the name of all properties in the list.
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
CMHPropertiesValuesList & operator=(const CMHPropertiesValuesList &o)
Copy operator.
The virtual base class which provides a unified interface for all persistent objects in MRPT.
An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable ...
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
CSerializable::Ptr get(const char *propertyName, const int64_t &hypothesis_ID) const
Returns the value of the property (case insensitive) for some given hypothesis ID,...
CMHPropertiesValuesList()
Default constructor.
Internal triplet for each property in utils::CMHPropertiesValuesList.
void set(const char *propertyName, const CSerializable::Ptr &obj, const int64_t &hypothesis_ID)
Sets/change the value of the property (case insensitive) for the given hypothesis ID,...
GLsizei const GLchar ** string
std::vector< TPropertyValueIDTriplet > m_properties
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
int _strcmpi(const char *str1, const char *str2) noexcept
An OS-independent version of strcmpi.
unsigned __int32 uint32_t
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
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 | |