|
Attribute of MemoryX entities. More...
#include <MemoryX/core/entity/EntityAttribute.h>
Public Member Functions | |
void | addElement (const ::memoryx::AttributeElement &elem, const ::Ice::Current &=Ice::emptyCurrent) override |
Adds attribute element (=value+uncertainty) to the attribute. More... | |
void | addValue (const ::armarx::VariantBasePtr &val, const ::Ice::Current &=Ice::emptyCurrent) override |
Adds value to the end of attribute values list. More... | |
void | addValueWithUncertainty (const ::armarx::VariantBasePtr &val, const ::memoryx::ProbabilityMeasureBasePtr &uncertainty, const ::Ice::Current &=Ice::emptyCurrent) override |
Adds value along with the corresponding uncertainty to the end of attribute values list. More... | |
void | clear (const ::Ice::Current &=Ice::emptyCurrent) override |
Clears all values. More... | |
EntityAttributePtr | clone (const Ice::Current &c=Ice::emptyCurrent) const |
void | deserialize (const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override |
EntityAttribute (const EntityAttribute &other) | |
Constructs a copy from another EntityAttribute instance. More... | |
EntityAttribute (const std::string &name) | |
Constructs a new EntityAttribute. More... | |
EntityAttribute (const std::string &name, const armarx::VariantBasePtr &val) | |
Constructs a new EntityAttribute and assigns a value. More... | |
::memoryx::AttributeElement | getElement (const ::Ice::Current &=Ice::emptyCurrent) const override |
Retrieves the attribute element (=value+uncertainty). More... | |
::memoryx::AttributeElement | getElementAt (::Ice::Int index, const ::Ice::Current &=Ice::emptyCurrent) const override |
Retrieves an attribute element (=value+uncertainty) with a given index. More... | |
::std::string | getName (const ::Ice::Current &=Ice::emptyCurrent) const override |
Retrieve name of the attribute. More... | |
::memoryx::ProbabilityMeasureBasePtr | getUncertainty (const ::Ice::Current &=Ice::emptyCurrent) const override |
Retrieves the uncertainty of the attribute value. More... | |
::memoryx::ProbabilityMeasureBasePtr | getUncertaintyAt (::Ice::Int index, const ::Ice::Current &=Ice::emptyCurrent) const override |
Retrieve the uncertainty of the value at a given index from the list of values stored in the attribute. More... | |
::armarx::VariantBasePtr | getValue (const ::Ice::Current &=Ice::emptyCurrent) const override |
Retrieves the value of the attribute. More... | |
::armarx::VariantBasePtr | getValueAt (::Ice::Int index, const ::Ice::Current &=Ice::emptyCurrent) const override |
Retrieve the value at a given index from the list of values stored in the attribute. More... | |
bool | hasValue (const ::armarx::VariantBasePtr &val, const ::Ice::Current &=Ice::emptyCurrent) const override |
Checks whether the value val is currently stored in the attribute. More... | |
Ice::ObjectPtr | ice_clone () const override |
void | removeValueAt (::Ice::Int index, const ::Ice::Current &=Ice::emptyCurrent) override |
Removes the value at a given index from the list of values stored in the attribute. More... | |
void | serialize (const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override |
void | setElement (const ::memoryx::AttributeElement &elem, const ::Ice::Current &=Ice::emptyCurrent) override |
Sets (single) attribute element (=value+uncertainty) to the attribute. More... | |
void | setValue (const ::armarx::VariantBasePtr &val, const ::Ice::Current &=Ice::emptyCurrent) override |
Sets (single) value of the attribute. More... | |
void | setValueWithUncertainty (const ::armarx::VariantBasePtr &val, const ::memoryx::ProbabilityMeasureBasePtr &uncertainty, const ::Ice::Current &=Ice::emptyCurrent) override |
Sets (single) value of the attribute along with the corresponding uncertainty. More... | |
::Ice::Int | size (const ::Ice::Current &=Ice::emptyCurrent) const override |
Retrieve number of values stored with the attribute. More... | |
~EntityAttribute () override | |
Protected Attributes | |
std::recursive_mutex | valuesMutex |
Friends | |
template<class IceBaseClass , class DerivedClass > | |
class | ::armarx::GenericFactory |
std::ostream & | operator<< (std::ostream &stream, const EntityAttribute &rhs) |
std::ostream & | operator<< (std::ostream &stream, const EntityAttributeBasePtr &rhs) |
std::ostream & | operator<< (std::ostream &stream, const EntityAttributePtr &rhs) |
Attribute of MemoryX entities.
Each memory entity can have an arbitraty number of attributes, identified by their names. Essentially, they are stored as a map std::string -> EntityAttribute. EntityAttribute has one or many AttributeElements, each of them representing a value with uncertainty as a pair (value, probabilityMeasure). See documentation of memoryx::AttributeElement for details on what types are supported as values.
Definition at line 48 of file EntityAttribute.h.
EntityAttribute | ( | const std::string & | name | ) |
Constructs a new EntityAttribute.
name | the attribute is identified via this name |
Definition at line 35 of file EntityAttribute.cpp.
EntityAttribute | ( | const std::string & | name, |
const armarx::VariantBasePtr & | val | ||
) |
Constructs a new EntityAttribute and assigns a value.
name | the attribute is identified via this name |
value | value for this attribute |
Definition at line 40 of file EntityAttribute.cpp.
EntityAttribute | ( | const EntityAttribute & | other | ) |
Constructs a copy from another EntityAttribute instance.
other | EntityAttribute to copy from |
Definition at line 46 of file EntityAttribute.cpp.
|
override |
Definition at line 74 of file EntityAttribute.cpp.
|
override |
Adds attribute element (=value+uncertainty) to the attribute.
elem | attribute element to add |
Definition at line 220 of file EntityAttribute.cpp.
|
override |
Adds value to the end of attribute values list.
Uncertainty assumed to be empty (=unknown/not specified).
val | value to add |
Definition at line 132 of file EntityAttribute.cpp.
|
override |
Adds value along with the corresponding uncertainty to the end of attribute values list.
This is equivalent to clearing the attribute value list (clear()) and calling addValueWithUncertainty().
val | value to set |
uncertainty | probability distribution representing the value uncertainty |
Definition at line 137 of file EntityAttribute.cpp.
|
override |
Clears all values.
The attribute will not contain any value after calling clear.
Definition at line 243 of file EntityAttribute.cpp.
EntityAttributePtr clone | ( | const Ice::Current & | c = Ice::emptyCurrent | ) | const |
|
override |
|
override |
Retrieves the attribute element (=value+uncertainty).
Corresponds to calling getElementAt(0).
Definition at line 226 of file EntityAttribute.cpp.
|
override |
Retrieves an attribute element (=value+uncertainty) with a given index.
Definition at line 231 of file EntityAttribute.cpp.
|
override |
Retrieve name of the attribute.
Definition at line 82 of file EntityAttribute.cpp.
|
override |
Retrieves the uncertainty of the attribute value.
Corresponds to calling getUncertaintyAt(0)
Definition at line 183 of file EntityAttribute.cpp.
|
override |
Retrieve the uncertainty of the value at a given index from the list of values stored in the attribute.
index | of value |
Definition at line 194 of file EntityAttribute.cpp.
|
override |
Retrieves the value of the attribute.
Corresponds to calling getValueAt(0)
Definition at line 178 of file EntityAttribute.cpp.
|
override |
Retrieve the value at a given index from the list of values stored in the attribute.
index | of value |
Definition at line 188 of file EntityAttribute.cpp.
|
override |
Checks whether the value val is currently stored in the attribute.
If attribute stores multiple values, each of them will be compared with val and in case of at least one match the result will be positive.
NOTE: currently, this method can be used for String values ONLY! To make it applicable for other datatypes, general comparison method for armarx::Variant should be implemented in Core first.
Definition at line 155 of file EntityAttribute.cpp.
|
override |
|
override |
Removes the value at a given index from the list of values stored in the attribute.
index | of value |
Definition at line 202 of file EntityAttribute.cpp.
|
override |
Definition at line 280 of file EntityAttribute.cpp.
|
override |
Sets (single) attribute element (=value+uncertainty) to the attribute.
This is equivalent to clearing the attribute value list (clear()) and calling addValue().
elem | attribute element to set |
Definition at line 212 of file EntityAttribute.cpp.
|
override |
Sets (single) value of the attribute.
Uncertainty assumed to be empty (=unknown/not specified). This is equivalent to clearing the attribute value list (clear()) and calling addValue().
val | value to set |
Definition at line 87 of file EntityAttribute.cpp.
|
override |
Sets (single) value of the attribute along with the corresponding uncertainty.
This is equivalent to clearing the attribute values list (clear()) and calling addValueWithUncertainty().
val | value to set |
uncertainty | probability distribution representing the value uncertainty |
Definition at line 103 of file EntityAttribute.cpp.
|
override |
Retrieve number of values stored with the attribute.
Definition at line 237 of file EntityAttribute.cpp.
|
friend |
Definition at line 53 of file EntityAttribute.h.
|
friend |
Definition at line 228 of file EntityAttribute.h.
|
friend |
Definition at line 240 of file EntityAttribute.h.
|
friend |
Definition at line 234 of file EntityAttribute.h.
|
mutableprotected |
Definition at line 222 of file EntityAttribute.h.