38 for (i = 0; i <
n; i++)
41 out << m_properties[i].name.c_str();
44 isNull = m_properties[i].value ? 1 : 0;
47 if (m_properties[i].
value) out << *m_properties[i].value;
70 m_properties.resize(
n);
71 for (i = 0; i <
n; i++)
76 m_properties[i].name = nameBuf;
82 m_properties[i].value.reset(
83 static_cast<CSerializable*>(
nullptr));
85 in >> m_properties[i].value;
106 : m_properties(o.m_properties)
110 it->value.reset(dynamic_cast<CSerializable*>(it->value->clone()));
119 if (
this != &o)
return *
this;
124 it->value.reset(dynamic_cast<CSerializable*>(it->value->clone()));
148 if (!
os::_strcmpi(propertyName.c_str(), it->name.c_str()))
166 if (!
os::_strcmpi(propertyName.c_str(), it->name.c_str()))
186 "Exception while setting annotation '%s'", propertyName.c_str()););
198 std::vector<std::string> ret;
203 ret.push_back(it->name);
void readFromStream(mrpt::utils::CStream &in, int version) override
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
CPropertiesValuesList & operator=(const CPropertiesValuesList &o)
Copy operator.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
std::vector< TPropertyValuePair > m_properties
The properties list: a map between strings and objects.
#define MRPT_END_WITH_CLEAN_UP(stuff)
This namespace provides a OS-independent interface to many useful functions: filenames manipulation...
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.
void clear()
Clears the list.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
const Scalar * const_iterator
GLsizei GLsizei GLuint * obj
void clear()
Clear the contents of this container.
size_t size() const
Returns the number of properties in the list.
virtual ~CPropertiesValuesList()
Destructor.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable ...
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
GLsizei const GLchar ** string
std::shared_ptr< CSerializable > Ptr
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
CPropertiesValuesList()
Default constructor.
CSerializable::Ptr get(const std::string &propertyName) const
Returns the value of the property (case insensitive), or nullptr if it does not exist.
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
GLsizei const GLfloat * value
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 ...
unsigned __int32 uint32_t
int _strcmpi(const char *str1, const char *str2) noexcept
An OS-independent version of strcmpi.