Relation Class Reference

Relation class represents a directed relation between entities. More...

#include <MemoryX/libraries/memorytypes/entity/Relation.h>

+ Inheritance diagram for Relation:

Public Member Functions

RelationPtr clone (const Ice::Current &c=Ice::emptyCurrent) const
 
std::string getAttributes () const
 
EntityRefList getEntities (const ::Ice::Current &=Ice::emptyCurrent) const override
 Retrieve the entities involved in this relation. More...
 
::Ice::Float getProb (const ::Ice::Current &=Ice::emptyCurrent) const override
 Retrieve probability that this relation actually exists. More...
 
bool getSign (const ::Ice::Current &=Ice::emptyCurrent) const override
 Retrieve whether this relation is true or false. More...
 
std::string getSourceAttributes () const
 
std::string getTargetAttributes () const
 
Ice::ObjectPtr ice_clone () const override
 
 Relation (const std::string &name="", const EntityRefList &entities=EntityRefList {}, bool sign=true, float prob=1.f)
 Constucts a new Relation. More...
 
void setAttributes (std::string const &attributes)
 
void setEntities (const EntityRefList &entities, const ::Ice::Current &=Ice::emptyCurrent) override
 set the entities involved in this relation More...
 
void setProb (::Ice::Float prob, const ::Ice::Current &=Ice::emptyCurrent) override
 Set probability that this relation actually exists. More...
 
void setSign (bool sign, const ::Ice::Current &=Ice::emptyCurrent) override
 Set whether this relation is true or false. More...
 
void setSourceAttributes (std::string const &attributes)
 
void setTargetAttributes (std::string const &attributes)
 
- Public Member Functions inherited from Entity
void __decRef () override
 
template<typename T >
IceInternal::Handle< TaddWrapper (T *wrapper)
 Add EntityWrapper to entity. More...
 
EntityPtr clone (const Ice::Current &c=Ice::emptyCurrent) const
 
void deserialize (const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
 Subclasses should use serializable attributes and consider these methods final. More...
 
bool equals (const EntityBasePtr &otherEntity, const ::Ice::Current &=Ice::emptyCurrent) const override
 equals computes if two Entity instances are equal. More...
 
bool equalsAttributes (const EntityBasePtr &otherEntity, const ::Ice::Current &=Ice::emptyCurrent) const override
 equalsAttributes computes if two Entity instances are equal. More...
 
virtual EntityRefBaseList getAllParentRefs (bool includeMetaEntities=true) const
 Retrieve all parents by traversing the whole hierarchy. More...
 
virtual std::vector< std::string > getAllParentsAsStringList () const
 
EntityAttributeBasePtr getAttribute (const ::std::string &attrName, const ::Ice::Current &=Ice::emptyCurrent) const override
 Retrieve attribute from entity. More...
 
memoryx::NameList getAttributeNames (const ::Ice::Current &=Ice::emptyCurrent) const override
 Retrieve list of all attribute names. More...
 
virtual armarx::VariantPtr getAttributeValue (const ::std::string &attrName) const
 Retrieve value of an attribute from entity. More...
 
virtual EntityRefBaseList getDirectParentRefs () const
 Retrieve parent entity references. More...
 
::std::string getId (const ::Ice::Current &=Ice::emptyCurrent) const override
 Retrieve id of this entity which is an integer in string representation. More...
 
::std::string getName (const ::Ice::Current &=Ice::emptyCurrent) const override
 Retrieve name of this entity. More...
 
template<typename T >
IceInternal::Handle< TgetWrapper ()
 Retrieve EntityWrapper that has previously been added with Entity::addWrapper(). More...
 
bool hasAttribute (const ::std::string &attrName, const ::Ice::Current &=Ice::emptyCurrent) const override
 Check whether this entity has an attribute with the given name. More...
 
Ice::ObjectPtr ice_clone () const override
 
bool isMetaEntity (const ::Ice::Current &=Ice::emptyCurrent) const override
 Indicates whether this entity only contains meta information. More...
 
void putAttribute (const ::memoryx::EntityAttributeBasePtr &attr, const ::Ice::Current &=Ice::emptyCurrent) override
 Store attribute in entity. More...
 
template<typename T >
void putAttribute (const std::string &attrName, T attrValue, ProbabilityMeasureBasePtr uncertainty=ProbabilityMeasureBasePtr())
 Create and store attribute from name, value, and optionally uncertainty measure. More...
 
void removeAttribute (const ::std::string &attrName, const ::Ice::Current &=Ice::emptyCurrent) override
 Remove attribute with given name from entity. More...
 
void serialize (const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
 Subclasses should use serializable attributes and consider these methods final. More...
 
virtual void setDirectParentRefs (const EntityRefBaseList &entityRefs)
 Replace parent entity references. More...
 
void setId (const ::std::string &id, const ::Ice::Current &=Ice::emptyCurrent) override
 Set id of this entity. More...
 
void setMetaEntity (bool isMetaEntity, const ::Ice::Current &=Ice::emptyCurrent) override
 Mark this entity as meta (i.e. More...
 
void setName (const ::std::string &name, const ::Ice::Current &=Ice::emptyCurrent) override
 Set name of this entity. More...
 

Friends

std::ostream & operator<< (std::ostream &stream, const Relation &rhs)
 
std::ostream & operator<< (std::ostream &stream, const RelationBasePtr &rhs)
 
std::ostream & operator<< (std::ostream &stream, const RelationPtr &rhs)
 

Additional Inherited Members

- Static Public Member Functions inherited from Entity
static EntityPtr CreateGenericEntity ()
 Creates an entity without any convenience getter/setter functions. More...
 
- Protected Member Functions inherited from Entity
 Entity ()
 
 Entity (const Entity &source)
 
void ice_postUnmarshal () override
 
void ice_preMarshal () override
 
void output (std::ostream &stream) const
 
 ~Entity () override
 
- Protected Attributes inherited from Entity
std::mutex attributesMutex
 
std::shared_mutex entityMutex
 
AbstractEntityWrapperBaseList wrappers
 
std::recursive_mutex wrappersMutex
 

Detailed Description

Relation class represents a directed relation between entities.

It allows to specify the uncertainty of this relation as DoB probability.

Definition at line 42 of file Relation.h.

Constructor & Destructor Documentation

◆ Relation()

Relation ( const std::string &  name = "",
const EntityRefList &  entities = EntityRefList {},
bool  sign = true,
float  prob = 1.f 
)

Constucts a new Relation.

Parameters
namename of the relation (and actually its type, i.e. "isOn")
entitiesthe list of entity refs between which this relation holds
signwhether the relation is known to be true or false
probexistence probability of relation

Definition at line 30 of file Relation.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Function Documentation

◆ clone()

RelationPtr clone ( const Ice::Current &  c = Ice::emptyCurrent) const

Definition at line 130 of file Relation.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAttributes()

std::string getAttributes ( ) const

Definition at line 94 of file Relation.cpp.

+ Here is the call graph for this function:

◆ getEntities()

EntityRefList getEntities ( const ::Ice::Current &  = Ice::emptyCurrent) const
override

Retrieve the entities involved in this relation.

Returns
list of entity refs

Definition at line 48 of file Relation.cpp.

+ Here is the call graph for this function:

◆ getProb()

Ice::Float getProb ( const ::Ice::Current &  = Ice::emptyCurrent) const
override

Retrieve probability that this relation actually exists.

Returns
existence probability

Definition at line 84 of file Relation.cpp.

+ Here is the call graph for this function:

◆ getSign()

bool getSign ( const ::Ice::Current &  = Ice::emptyCurrent) const
override

Retrieve whether this relation is true or false.

Returns
the sign

Definition at line 74 of file Relation.cpp.

+ Here is the call graph for this function:

◆ getSourceAttributes()

std::string getSourceAttributes ( ) const

Definition at line 104 of file Relation.cpp.

+ Here is the call graph for this function:

◆ getTargetAttributes()

std::string getTargetAttributes ( ) const

Definition at line 114 of file Relation.cpp.

+ Here is the call graph for this function:

◆ ice_clone()

Ice::ObjectPtr ice_clone ( ) const
override

Definition at line 125 of file Relation.cpp.

+ Here is the call graph for this function:

◆ setAttributes()

void setAttributes ( std::string const &  attributes)

Definition at line 99 of file Relation.cpp.

+ Here is the call graph for this function:

◆ setEntities()

void setEntities ( const EntityRefList &  entities,
const ::Ice::Current &  = Ice::emptyCurrent 
)
override

set the entities involved in this relation

Parameters
entitieslist of entity refs

Definition at line 61 of file Relation.cpp.

+ Here is the call graph for this function:

◆ setProb()

void setProb ( ::Ice::Float  prob,
const ::Ice::Current &  = Ice::emptyCurrent 
)
override

Set probability that this relation actually exists.

@prob existence probability

Definition at line 89 of file Relation.cpp.

+ Here is the call graph for this function:

◆ setSign()

void setSign ( bool  sign,
const ::Ice::Current &  = Ice::emptyCurrent 
)
override

Set whether this relation is true or false.

Parameters
signthe sign

Definition at line 79 of file Relation.cpp.

+ Here is the call graph for this function:

◆ setSourceAttributes()

void setSourceAttributes ( std::string const &  attributes)

Definition at line 109 of file Relation.cpp.

+ Here is the call graph for this function:

◆ setTargetAttributes()

void setTargetAttributes ( std::string const &  attributes)

Definition at line 119 of file Relation.cpp.

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator<< [1/3]

std::ostream& operator<< ( std::ostream &  stream,
const Relation rhs 
)
friend

Definition at line 118 of file Relation.h.

◆ operator<< [2/3]

std::ostream& operator<< ( std::ostream &  stream,
const RelationBasePtr &  rhs 
)
friend

Definition at line 130 of file Relation.h.

◆ operator<< [3/3]

std::ostream& operator<< ( std::ostream &  stream,
const RelationPtr rhs 
)
friend

Definition at line 124 of file Relation.h.


The documentation for this class was generated from the following files: