Go to the documentation of this file.
26 void CPropertiesValuesList::serializeTo(
33 for (i = 0; i <
n; i++)
36 out << m_properties[i].name.c_str();
39 isNull = m_properties[i].value ? 1 : 0;
42 if (m_properties[i].
value) out << *m_properties[i].value;
46 void CPropertiesValuesList::serializeFrom(
61 m_properties.resize(
n);
62 for (i = 0; i <
n; i++)
67 m_properties[i].name = nameBuf;
73 m_properties[i].value.reset(
76 in >> m_properties[i].value;
88 CPropertiesValuesList::CPropertiesValuesList() {}
92 CPropertiesValuesList::~CPropertiesValuesList() {
clear(); }
97 : m_properties(o.m_properties)
101 it->value.reset(
dynamic_cast<CSerializable*
>(it->value->clone()));
110 if (
this != &o)
return *
this;
115 it->value.reset(
dynamic_cast<CSerializable*
>(it->value->clone()));
139 if (!
os::_strcmpi(propertyName.c_str(), it->name.c_str()))
157 if (!
os::_strcmpi(propertyName.c_str(), it->name.c_str()))
177 "Exception while setting annotation '%s'", propertyName.c_str()););
189 std::vector<std::string> ret;
194 ret.push_back(it->name);
void clear()
Clear the contents of this container.
const Scalar * const_iterator
CSerializable::Ptr get(const std::string &propertyName) const
Returns the value of the property (case insensitive), or nullptr if it does not exist.
std::shared_ptr< CSerializable > Ptr
#define MRPT_END_WITH_CLEAN_UP(stuff)
GLsizei GLsizei GLuint * obj
Virtual base class for "archives": classes abstracting I/O streams.
Classes related to the implementation of Hybrid Metric Topological (HMT) SLAM.
The virtual base class which provides a unified interface for all persistent objects in MRPT.
std::vector< std::string > getPropertyNames() const
Returns the name of all properties in the list.
An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable ...
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
void clear()
Clears the list.
GLsizei const GLfloat * value
CPropertiesValuesList & operator=(const CPropertiesValuesList &o)
Copy operator.
GLsizei const GLchar ** string
size_t size() const
Returns the number of properties in the list.
#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
std::vector< TPropertyValuePair > m_properties
The properties list: a map between strings and objects.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
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 ...
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 | |