9 #ifndef CMHPropertiesValuesList_H 10 #define CMHPropertiesValuesList_H 70 const char* propertyName,
const int64_t& hypothesis_ID)
const;
78 const char* propertyName,
const int64_t& hypothesis_ID,
79 bool allowNullPointer =
true)
const 86 return typename T::Ptr();
92 return std::dynamic_pointer_cast<T>(
obj);
121 void remove(
const char* propertyName,
const int64_t& hypothesis_ID);
132 const char* propertyName,
const T&
data,
const int64_t& hypothesis_ID)
137 memChunk->setAllocBlockSize(10);
144 if (it->ID == hypothesis_ID &&
149 it->value = memChunk;
157 newPair.
value = memChunk;
158 newPair.
ID = hypothesis_ID;
162 printf(
"Exception while setting annotation '%s'", propertyName););
172 const char* propertyName, T& out_data,
const int64_t& hypothesis_ID,
173 bool raiseExceptionIfNotFound =
false)
const 181 it->ID == hypothesis_ID)
186 if (memChunk->getTotalBytesCount() !=
sizeof(out_data))
188 out_data = *
static_cast<T*
>(memChunk->getRawBufferData());
193 if (raiseExceptionIfNotFound)
An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable ...
TPropertyValueIDTriplet()
std::vector< TPropertyValueIDTriplet >::const_iterator const_iterator
#define MRPT_END_WITH_CLEAN_UP(stuff)
The virtual base class which provides a unified interface for all persistent objects in MRPT...
const_iterator end() const
#define THROW_EXCEPTION(msg)
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
CMHPropertiesValuesList()
Default constructor.
void setElemental(const char *propertyName, const T &data, const int64_t &hypothesis_ID)
Sets/change the value of a property (case insensitive) for the given hypothesis ID, from an elemental data type.
const Scalar * const_iterator
GLsizei GLsizei GLuint * obj
Internal triplet for each property in utils::CMHPropertiesValuesList.
CMHPropertiesValuesList & operator=(const CMHPropertiesValuesList &o)
Copy operator.
T::Ptr getAs(const char *propertyName, const int64_t &hypothesis_ID, bool allowNullPointer=true) const
Returns the value of the property (case insensitive) for some given hypothesis ID checking its class ...
A memory buffer (implements CStream) which can be itself serialized.
void removeAll(const int64_t &hypothesis_ID)
Remove all the properties for the given hypothesis.
GLsizei const GLchar ** string
std::shared_ptr< CSerializable > Ptr
const_iterator begin() const
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
std::vector< TPropertyValueIDTriplet >::iterator iterator
virtual ~CMHPropertiesValuesList()
Destructor.
GLuint const GLchar * name
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.
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...
GLsizei const GLfloat * value
A structure that holds runtime class type information.
std::shared_ptr< CMemoryChunk > Ptr
std::vector< TPropertyValueIDTriplet > m_properties
bool strCmpI(const std::string &s1, const std::string &s2)
Return true if the two strings are equal (case insensitive)
GLsizei GLsizei GLenum GLenum const GLvoid * data
CSerializable::Ptr getAnyHypothesis(const char *propertyName) const
Returns the value of the property (case insensitive) for the first hypothesis ID found, or nullptr if it does not exist.
bool getElemental(const char *propertyName, T &out_data, const int64_t &hypothesis_ID, bool raiseExceptionIfNotFound=false) const
Gets the value of a property (case insensitive) for the given hypothesis ID, retrieves it as an eleme...