39 out << m_properties[i].name.c_str();
42 isNull = !m_properties[i].value;
46 out << *m_properties[i].value;
49 out << m_properties[i].ID;
73 m_properties.resize(
n);
79 m_properties[i].name = nameBuf;
85 m_properties[i].value.clear();
87 in >> m_properties[i].value;
90 in >> m_properties[i].ID;
123 m_properties.clear();
131 const char *propertyName,
132 const int64_t &hypothesis_ID)
const
135 for (it=m_properties.begin();it!=m_properties.end();++it)
136 if (!
os::_strcmpi(propertyName,it->name.c_str()) && it->ID == hypothesis_ID )
139 for (it=m_properties.begin();it!=m_properties.end();++it)
140 if (!
os::_strcmpi(propertyName,it->name.c_str()) && it->ID == 0 )
144 return CSerializablePtr();
158 return CSerializablePtr();
165 const char *propertyName,
166 const CSerializablePtr &
obj,
173 if ( it->ID == hypothesis_ID && !
os::_strcmpi(propertyName,it->name.c_str()) )
178 it->value.make_unique();
190 newPair.
ID = hypothesis_ID;
191 m_properties.push_back(newPair);
194 printf(
"Exception while setting annotation '%s'",propertyName); \
202 const char *propertyName,
203 const CSerializablePtr &
obj,
210 if ( it->ID == hypothesis_ID && !
os::_strcmpi(propertyName,it->name.c_str()) )
222 newPair.
ID = hypothesis_ID;
223 m_properties.push_back(newPair);
226 printf(
"Exception while setting annotation '%s'",propertyName); \
237 std::vector<std::string> ret;
244 if ( (*itS) == it->name )
251 ret.push_back(it->name);
261 const char *propertyName,
265 if (!
os::_strcmpi(propertyName,it->name.c_str()) && it->ID == hypothesis_ID )
266 it = m_properties.erase(it);
276 if (it->ID == hypothesis_ID )
277 it = m_properties.erase(it);
287 m_properties ( o.m_properties )
290 it->value.make_unique();
298 if (
this==&o)
return *
this;
303 it->value.make_unique();
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable ...
CMHPropertiesValuesList()
Default constructor.
void readFromStream(mrpt::utils::CStream &in, int version)
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
virtual ~CMHPropertiesValuesList()
Destructor.
void remove(const char *propertyName, const int64_t &hypothesis_ID)
Remove a given property, if it exists.
CMHPropertiesValuesList & operator=(const CMHPropertiesValuesList &o)
Copy operator.
CSerializablePtr getAnyHypothesis(const char *propertyName) const
Returns the value of the property (case insensitive) for the first hypothesis ID found,...
std::vector< std::string > getPropertyNames() const
Returns the name of all properties in the list.
std::vector< TPropertyValueIDTriplet > m_properties
void set(const char *propertyName, const CSerializablePtr &obj, const int64_t &hypothesis_ID)
Sets/change the value of the property (case insensitive) for the given hypothesis ID,...
void setMemoryReference(const char *propertyName, const CSerializablePtr &obj, const int64_t &hypothesis_ID)
Sets/change the value of the property (case insensitive) for the given hypothesis ID,...
void removeAll(const int64_t &hypothesis_ID)
Remove all the properties for the given hypothesis.
void clear()
Clears the list and frees all object's memory.
CSerializablePtr get(const char *propertyName, const int64_t &hypothesis_ID) const
Returns the value of the property (case insensitive) for some given hypothesis ID,...
The virtual base class which provides a unified interface for all persistent objects in MRPT.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
const Scalar * const_iterator
GLsizei GLsizei GLuint * obj
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
GLsizei const GLchar ** string
int BASE_IMPEXP _strcmpi(const char *str1, const char *str2) MRPT_NO_THROWS
An OS-independent version of strcmpi.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
#define MRPT_END_WITH_CLEAN_UP(stuff)
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values,...
void clear()
Clear the contents of this container.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
unsigned __int32 uint32_t
Internal triplet for each property in utils::CMHPropertiesValuesList.