Go to the documentation of this file.
9 #ifndef CMHPropertiesValuesList_H
10 #define CMHPropertiesValuesList_H
69 CSerializable::Ptr
get(
70 const char* propertyName,
const int64_t& hypothesis_ID)
const;
78 const char* propertyName,
const int64_t& hypothesis_ID,
79 bool allowNullPointer =
true)
const
82 CSerializable::Ptr
obj =
get(propertyName, hypothesis_ID);
86 return typename T::Ptr();
91 &T::GetRuntimeClassIdStatic();
93 return std::dynamic_pointer_cast<T>(
obj);
108 const char* propertyName,
const CSerializable::Ptr&
obj,
117 const char* propertyName,
const CSerializable::Ptr&
obj,
122 void remove(
const char* propertyName,
const int64_t& hypothesis_ID);
133 const char* propertyName,
const T&
data,
const int64_t& hypothesis_ID)
138 basic_value.resize(
sizeof(T));
143 if (it->ID == hypothesis_ID &&
148 it->basic_value = basic_value;
157 newPair.
ID = hypothesis_ID;
161 printf(
"Exception while setting annotation '%s'", propertyName););
171 const char* propertyName, T& out_data,
const int64_t& hypothesis_ID,
172 bool raiseExceptionIfNotFound =
false)
const
178 it->ID == hypothesis_ID)
180 if (it->basic_value.size() !=
sizeof(out_data))
182 out_data = *
reinterpret_cast<const T*
>(&it->basic_value[0]);
187 if (raiseExceptionIfNotFound)
const Scalar * const_iterator
const_iterator begin() const
A structure that holds runtime class type information.
std::shared_ptr< CSerializable > Ptr
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...
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 ...
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,...
#define MRPT_END_WITH_CLEAN_UP(stuff)
TPropertyValueIDTriplet()
GLsizei GLsizei GLuint * obj
virtual ~CMHPropertiesValuesList()
Destructor.
void removeAll(const int64_t &hypothesis_ID)
Remove all the properties for the given hypothesis.
void remove(const char *propertyName, const int64_t &hypothesis_ID)
Remove a given property, if it exists.
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define THROW_EXCEPTION(msg)
#define ASSERT_(f)
Defines an assertion mechanism.
void clear()
Clears the list and frees all object's memory.
mrpt::serialization::CSerializable::Ptr value
GLuint const GLchar * name
CSerializable::Ptr getAnyHypothesis(const char *propertyName) const
Returns the value of the property (case insensitive) for the first hypothesis ID found,...
GLsizei GLsizei GLenum GLenum const GLvoid * data
std::vector< std::string > getPropertyNames() const
Returns the name of all properties in the list.
const_iterator end() const
CMHPropertiesValuesList & operator=(const CMHPropertiesValuesList &o)
Copy operator.
The virtual base class which provides a unified interface for all persistent objects in MRPT.
An arbitrary list of "annotations", or named attributes, each being an instance of any CSerializable ...
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,...
CSerializable::Ptr get(const char *propertyName, const int64_t &hypothesis_ID) const
Returns the value of the property (case insensitive) for some given hypothesis ID,...
std::vector< TPropertyValueIDTriplet >::iterator iterator
CMHPropertiesValuesList()
Default constructor.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Internal triplet for each property in utils::CMHPropertiesValuesList.
GLsizei const GLfloat * value
void set(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 GLchar ** string
std::vector< TPropertyValueIDTriplet >::const_iterator const_iterator
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)
void memcpy(void *dest, size_t destSize, const void *src, size_t copyCount) noexcept
An OS and compiler independent version of "memcpy".
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 | |