66 CSerializable::Ptr
get(
67 const char* propertyName,
const int64_t& hypothesis_ID)
const;
75 const char* propertyName,
const int64_t& hypothesis_ID,
76 bool allowNullPointer =
true)
const 79 CSerializable::Ptr
obj =
get(propertyName, hypothesis_ID);
83 return typename T::Ptr();
88 &T::GetRuntimeClassIdStatic();
90 return std::dynamic_pointer_cast<T>(
obj);
105 const char* propertyName,
const CSerializable::Ptr&
obj,
114 const char* propertyName,
const CSerializable::Ptr&
obj,
119 void remove(
const char* propertyName,
const int64_t& hypothesis_ID);
130 const char* propertyName,
const T&
data,
const int64_t& hypothesis_ID)
135 basic_value.resize(
sizeof(T));
140 if (m_propertie.ID == hypothesis_ID &&
145 m_propertie.basic_value = basic_value;
154 newPair.
ID = hypothesis_ID;
158 printf(
"Exception while setting annotation '%s'", propertyName););
168 const char* propertyName, T& out_data,
const int64_t& hypothesis_ID,
169 bool raiseExceptionIfNotFound =
false)
const 175 m_propertie.ID == hypothesis_ID)
177 if (m_propertie.basic_value.size() !=
sizeof(out_data))
180 *
reinterpret_cast<const T*
>(&m_propertie.basic_value[0]);
185 if (raiseExceptionIfNotFound)
195 using iterator = std::vector<TPropertyValueIDTriplet>::iterator;
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 ...
#define THROW_EXCEPTION(msg)
Classes related to the implementation of Hybrid Metric Topological (HMT) SLAM.
A structure that holds runtime class type information.
#define MRPT_END_WITH_CLEAN_UP(stuff)
GLsizei GLsizei GLuint * obj
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.
void removeAll(const int64_t &hypothesis_ID)
Remove all the properties for the given hypothesis.
CMHPropertiesValuesList()
Default constructor.
#define ASSERT_(f)
Defines an assertion mechanism.
const_iterator end() const
~CMHPropertiesValuesList() override
Destructor.
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.
void clear()
Clears the list and frees all object's memory.
std::vector< TPropertyValueIDTriplet >::const_iterator const_iterator
std::vector< TPropertyValueIDTriplet >::iterator iterator
GLsizei const GLchar ** string
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
CMHPropertiesValuesList & operator=(const CMHPropertiesValuesList &o)
Copy operator.
Internal triplet for each property in utils::CMHPropertiesValuesList.
mrpt::serialization::CSerializable::Ptr value
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 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...
const_iterator begin() const
std::vector< std::string > getPropertyNames() const
Returns the name of all properties in the list.
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...
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
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
TPropertyValueIDTriplet()=default
std::vector< TPropertyValueIDTriplet > m_properties
void memcpy(void *dest, size_t destSize, const void *src, size_t copyCount) noexcept
An OS and compiler independent version of "memcpy".