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();
An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable ...
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...
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
#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...
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 remove(const char *propertyName, const int64_t &hypothesis_ID)
Remove a given property, if it exists.
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...
CMHPropertiesValuesList()
Default constructor.
const Scalar * const_iterator
IMPLEMENTS_SERIALIZABLE(CLogFileRecord_FullEval, CHolonomicLogFileRecord, mrpt::nav) IMPLEMENTS_SERIALIZABLE(CHolonomicFullEval
GLsizei GLsizei GLuint * obj
void clear()
Clear the contents of this container.
CSerializablePtr getAnyHypothesis(const char *propertyName) const
Returns the value of the property (case insensitive) for the first hypothesis ID found, or NULL if it does not exist.
Internal triplet for each property in utils::CMHPropertiesValuesList.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
CMHPropertiesValuesList & operator=(const CMHPropertiesValuesList &o)
Copy operator.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
void removeAll(const int64_t &hypothesis_ID)
Remove all the properties for the given hypothesis.
GLsizei const GLchar ** string
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
CSerializablePtr get(const char *propertyName, const int64_t &hypothesis_ID) const
Returns the value of the property (case insensitive) for some given hypothesis ID, or a NULL smart pointer if it does not exist.
virtual ~CMHPropertiesValuesList()
Destructor.
int BASE_IMPEXP _strcmpi(const char *str1, const char *str2) MRPT_NO_THROWS
An OS-independent version of strcmpi.
void clear()
Clears the list and frees all object's memory.
std::vector< std::string > getPropertyNames() const
Returns the name of all properties in the list.
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
std::vector< TPropertyValueIDTriplet > m_properties
unsigned __int32 uint32_t