WorkingMemoryEntitySegment< T > Class Template Reference

#include <MemoryX/libraries/workingmemory/WorkingMemoryEntitySegment.h>

+ Inheritance diagram for WorkingMemoryEntitySegment< T >:

Public Member Functions

std::string addEntity (const EntityBasePtr &entity, const ::Ice::Current &c=Ice::emptyCurrent) override
 addEntity addes an entity to this segment. The registered fusion methods are applied in order to fuse the entity entry. More...
 
EntityIdList addEntityList (const EntityBaseList &entityList, const ::Ice::Current &c) override
 
void addFusionMethod (const ::memoryx::EntityFusionMethodBasePtr &fusionMethod, const ::Ice::Current &c=Ice::emptyCurrent) override
 
void clear (const ::Ice::Current &c=Ice::emptyCurrent) override
 
EntityBaseList getAllEntities (const Ice::Current &c=Ice::emptyCurrent) const override
 
EntityIdList getAllEntityIds (const Ice::Current &c=Ice::emptyCurrent) const override
 
EntityBaseList getEntitiesByAttrValue (const ::std::string &attrName, const ::std::string &attrValue) const
 
EntityBaseList getEntitiesByAttrValue (const ::std::string &attrName, const ::std::string &attrValue, const ::Ice::Current &c) const override
 
EntityBaseList getEntitiesByAttrValueList (const ::std::string &attrName, const NameList &attrValueList) const
 
EntityBaseList getEntitiesByAttrValueList (const ::std::string &attrName, const NameList &attrValueList, const ::Ice::Current &c) const override
 
EntityBasePtr getEntityById (const ::std::string &id) const
 
EntityBasePtr getEntityById (const ::std::string &id, const ::Ice::Current &c) const override
 
EntityBasePtr getEntityByName (const ::std::string &name) const
 
EntityBasePtr getEntityByName (const ::std::string &name, const ::Ice::Current &c) const override
 
EntityRefBasePtr getEntityRefById (const std::string &id, const Ice::Current &c) const override
 
EntityRefBasePtr getEntityRefByName (const std::string &name, const Ice::Current &c) const override
 
Ice::Identity getIceId (const ::Ice::Current &c) const override
 
IdEntityMap getIdEntityMap (const Ice::Current &c=Ice::emptyCurrent) const override
 
WorkingMemoryListenerInterfacePrx getListenerProxy (const ::Ice::Current &c=Ice::emptyCurrent) override
 getListener The topic on which changes are reported. More...
 
std::string getObjectTypeId (const ::Ice::Current &c=Ice::emptyCurrent) const override
 getObjectTypeId returns the ice_staticId() of the entities stored inside this WorkingMemorySegment More...
 
std::string getSegmentName (const ::Ice::Current &c=Ice::emptyCurrent) const override
 
bool hasEntityById (const std::string &entityId, const ::Ice::Current &c) const override
 
bool hasEntityByName (const std::string &entityName, const ::Ice::Current &c) const override
 
void print (const ::Ice::Current &c=Ice::emptyCurrent) const override
 
void removeAllEntities (const ::Ice::Current &c=Ice::emptyCurrent) override
 
void removeEntity (const ::std::string &id, const ::Ice::Current &c=Ice::emptyCurrent) override
 
void setEntityAttribute (const std::string &entityId, const EntityAttributeBasePtr &attribute, const ::Ice::Current &c) override
 
void setEntityAttributes (const std::string &entityId, const EntityAttributeList &attributeMap, const ::Ice::Current &c) override
 
Ice::Int size (const ::Ice::Current &c=Ice::emptyCurrent) const override
 
void updateEntity (const std::string &entityId, const EntityBasePtr &update, const ::Ice::Current &c=Ice::emptyCurrent) override
 
void updateEntity (const std::string &entityId, const EntityBasePtr &update, const Ice::StringSeq &deactivatedFusionMethods, const ::Ice::Current &c=Ice::emptyCurrent)
 
std::string upsertEntity (const std::string &entityId, const EntityBasePtr &newEntity, const ::Ice::Current &c=Ice::emptyCurrent) override
 
std::string upsertEntityByName (const std::string &entityName, const EntityBasePtr &newEntity, const ::Ice::Current &c=Ice::emptyCurrent) override
 
EntityIdList upsertEntityList (const EntityBaseList &entityList, const ::Ice::Current &c) override
 
 WorkingMemoryEntitySegment ()
 
- Public Member Functions inherited from SegmentUtilImplementations
EntityBaseList getEntityWithChildrenById (const std::string &id, bool includeMetaEntities, const Ice::Current &c=Ice::emptyCurrent) const override
 
EntityBaseList getEntityWithChildrenByName (const std::string &, bool includeMetaEntities, const Ice::Current &c=Ice::emptyCurrent) const override
 
std::string getJSONEntityById (const std::string &id, const Ice::Current &) const override
 
ScopedSharedLockPtr getReadLock (const Ice::Current &c) const
 
ScopedUniqueLockPtr getWriteLock (const Ice::Current &c) const
 
bool keepLockAlive (const std::string &token, const Ice::Current &) override
 
SegmentLockBasePtr lockSegment (const Ice::Current &c) override
 
 SegmentUtilImplementations ()
 
bool unlockSegment (const SegmentLockBasePtr &lock, const Ice::Current &c) override
 
bool unlockSegmentWithToken (const std::string &token, const Ice::Current &c) override
 

Protected Member Functions

std::string addEntityThreadUnsafe (const EntityBasePtr &newEntity)
 adds the entity to the segment. More...
 
void fuseEntity (const EntityBasePtr &entity)
 
EntityBasePtr getEntityByIdUnsafe (const ::std::string &id) const
 
EntityBasePtr getEntityByNameThreadUnsafe (const ::std::string &name) const
 
bool hasEntityByIdThreadUnsafe (const std::string &entityId) const
 
void setListenerProxy (const WorkingMemoryListenerInterfacePrx &listenerProxy, const ::Ice::Current &c=Ice::emptyCurrent) override
 
void setParentMemory (const MemoryInterfacePtr &memory, const ::Ice::Current &c) override
 
void setSegmentName (const std::string &segmentName, const ::Ice::Current &c=Ice::emptyCurrent) override
 
void updateEntityThreadUnsafe (const std::string &entityId, const EntityBasePtr &update, const Ice::StringSeq &deactivatedFusionMethods)
 
- Protected Member Functions inherited from SegmentUtilImplementations
void keepAliveCheck ()
 

Protected Attributes

IdEntityMap entityMap
 
EntityFusionMethodPtr fusionMethod
 
int lastEntityId
 
MemoryInterfacePtr parentMemory
 
std::string segmentName
 
- Protected Attributes inherited from SegmentUtilImplementations
armarx::PeriodicTask< SegmentUtilImplementations >::pointer_type keepAliveCheckTask
 
IceUtil::Time keepAliveTimestamp
 
std::mutex keepAliveTimestampMutex
 
std::string lockToken
 
std::mutex mutex
 
ScopedSharedLockPtr readLock
 
std::shared_mutex segmentMutex
 
EntityMemorySegmentInterfacePrx selfProxy
 
std::mutex tokenMutex
 
ScopedUniqueLockPtr writeLock
 

Friends

class SegmentedMemory
 

Additional Inherited Members

- Public Types inherited from SegmentUtilImplementations
using ScopedSharedLock = std::unique_lock< std::shared_mutex >
 
using ScopedSharedLockPtr = std::unique_ptr< ScopedSharedLock >
 
using ScopedUniqueLock = std::unique_lock< std::shared_mutex >
 
using ScopedUniqueLockPtr = std::unique_ptr< ScopedSharedLock >
 

Detailed Description

template<class T>
class memoryx::WorkingMemoryEntitySegment< T >

This class represents segments in the WorkingMemory

Definition at line 44 of file WorkingMemoryEntitySegment.h.

Constructor & Destructor Documentation

◆ WorkingMemoryEntitySegment()

Definition at line 51 of file WorkingMemoryEntitySegment.h.

Member Function Documentation

◆ addEntity()

std::string addEntity ( const EntityBasePtr &  entity,
const ::Ice::Current &  c = Ice::emptyCurrent 
)
inlineoverride

addEntity addes an entity to this segment. The registered fusion methods are applied in order to fuse the entity entry.

When ObjectInstances are used as template parameter the

See also
PriorAttributeEnrichmentFusion is used to enrich the attributes by prior knowledge data (i.e. 3D models etc)
Parameters
entityThe entity to add. The attributes of the added entry may be enriched by fusion methods (e.g. PriorAttributeEnrichmentFusion)
Returns
The id of the newly created entry.

Definition at line 164 of file WorkingMemoryEntitySegment.h.

+ Here is the caller graph for this function:

◆ addEntityList()

EntityIdList addEntityList ( const EntityBaseList &  entityList,
const ::Ice::Current &  c 
)
inlineoverride

Definition at line 174 of file WorkingMemoryEntitySegment.h.

◆ addEntityThreadUnsafe()

std::string addEntityThreadUnsafe ( const EntityBasePtr &  newEntity)
inlineprotected

adds the entity to the segment.

Note
Does not lock the segment! use AddEntity instead.
Parameters
newEntity
Returns
id of new entity
See also
addEntity

Definition at line 109 of file WorkingMemoryEntitySegment.h.

◆ addFusionMethod()

void addFusionMethod ( const ::memoryx::EntityFusionMethodBasePtr &  fusionMethod,
const ::Ice::Current &  c = Ice::emptyCurrent 
)
inlineoverride

Definition at line 67 of file WorkingMemoryEntitySegment.h.

◆ clear()

void clear ( const ::Ice::Current &  c = Ice::emptyCurrent)
inlineoverride

Definition at line 365 of file WorkingMemoryEntitySegment.h.

◆ fuseEntity()

void fuseEntity ( const EntityBasePtr &  entity)
inlineprotected

Definition at line 78 of file WorkingMemoryEntitySegment.h.

◆ getAllEntities()

EntityBaseList getAllEntities ( const Ice::Current &  c = Ice::emptyCurrent) const
inlineoverride

Definition at line 585 of file WorkingMemoryEntitySegment.h.

◆ getAllEntityIds()

EntityIdList getAllEntityIds ( const Ice::Current &  c = Ice::emptyCurrent) const
inlineoverride

Definition at line 573 of file WorkingMemoryEntitySegment.h.

◆ getEntitiesByAttrValue() [1/2]

EntityBaseList getEntitiesByAttrValue ( const ::std::string &  attrName,
const ::std::string &  attrValue 
) const
inline

Definition at line 514 of file WorkingMemoryEntitySegment.h.

◆ getEntitiesByAttrValue() [2/2]

EntityBaseList getEntitiesByAttrValue ( const ::std::string &  attrName,
const ::std::string &  attrValue,
const ::Ice::Current &  c 
) const
inlineoverride

Definition at line 507 of file WorkingMemoryEntitySegment.h.

◆ getEntitiesByAttrValueList() [1/2]

EntityBaseList getEntitiesByAttrValueList ( const ::std::string &  attrName,
const NameList &  attrValueList 
) const
inline

Definition at line 521 of file WorkingMemoryEntitySegment.h.

◆ getEntitiesByAttrValueList() [2/2]

EntityBaseList getEntitiesByAttrValueList ( const ::std::string &  attrName,
const NameList &  attrValueList,
const ::Ice::Current &  c 
) const
inlineoverride

Definition at line 546 of file WorkingMemoryEntitySegment.h.

◆ getEntityById() [1/2]

EntityBasePtr getEntityById ( const ::std::string &  id) const
inline

Definition at line 427 of file WorkingMemoryEntitySegment.h.

◆ getEntityById() [2/2]

EntityBasePtr getEntityById ( const ::std::string &  id,
const ::Ice::Current &  c 
) const
inlineoverride

Definition at line 433 of file WorkingMemoryEntitySegment.h.

◆ getEntityByIdUnsafe()

EntityBasePtr getEntityByIdUnsafe ( const ::std::string &  id) const
inlineprotected

Definition at line 726 of file WorkingMemoryEntitySegment.h.

◆ getEntityByName() [1/2]

EntityBasePtr getEntityByName ( const ::std::string &  name) const
inline

Definition at line 451 of file WorkingMemoryEntitySegment.h.

◆ getEntityByName() [2/2]

EntityBasePtr getEntityByName ( const ::std::string &  name,
const ::Ice::Current &  c 
) const
inlineoverride

Definition at line 480 of file WorkingMemoryEntitySegment.h.

◆ getEntityByNameThreadUnsafe()

EntityBasePtr getEntityByNameThreadUnsafe ( const ::std::string &  name) const
inlineprotected

Definition at line 457 of file WorkingMemoryEntitySegment.h.

◆ getEntityRefById()

EntityRefBasePtr getEntityRefById ( const std::string &  id,
const Ice::Current &  c 
) const
inlineoverride

Definition at line 664 of file WorkingMemoryEntitySegment.h.

◆ getEntityRefByName()

EntityRefBasePtr getEntityRefByName ( const std::string &  name,
const Ice::Current &  c 
) const
inlineoverride

Definition at line 684 of file WorkingMemoryEntitySegment.h.

◆ getIceId()

Ice::Identity getIceId ( const ::Ice::Current &  c) const
inlineoverride

Definition at line 719 of file WorkingMemoryEntitySegment.h.

◆ getIdEntityMap()

IdEntityMap getIdEntityMap ( const Ice::Current &  c = Ice::emptyCurrent) const
inlineoverride

Definition at line 599 of file WorkingMemoryEntitySegment.h.

◆ getListenerProxy()

WorkingMemoryListenerInterfacePrx getListenerProxy ( const ::Ice::Current &  c = Ice::emptyCurrent)
inlineoverride

getListener The topic on which changes are reported.

Returns
NULL if disabled.

Definition at line 631 of file WorkingMemoryEntitySegment.h.

◆ getObjectTypeId()

std::string getObjectTypeId ( const ::Ice::Current &  c = Ice::emptyCurrent) const
inlineoverride

getObjectTypeId returns the ice_staticId() of the entities stored inside this WorkingMemorySegment

Returns

Definition at line 62 of file WorkingMemoryEntitySegment.h.

◆ getSegmentName()

std::string getSegmentName ( const ::Ice::Current &  c = Ice::emptyCurrent) const
inlineoverride

Definition at line 622 of file WorkingMemoryEntitySegment.h.

◆ hasEntityById()

bool hasEntityById ( const std::string &  entityId,
const ::Ice::Current &  c 
) const
inlineoverride

Definition at line 397 of file WorkingMemoryEntitySegment.h.

◆ hasEntityByIdThreadUnsafe()

bool hasEntityByIdThreadUnsafe ( const std::string &  entityId) const
inlineprotected

Definition at line 403 of file WorkingMemoryEntitySegment.h.

◆ hasEntityByName()

bool hasEntityByName ( const std::string &  entityName,
const ::Ice::Current &  c 
) const
inlineoverride

Definition at line 410 of file WorkingMemoryEntitySegment.h.

◆ print()

void print ( const ::Ice::Current &  c = Ice::emptyCurrent) const
inlineoverride

Definition at line 612 of file WorkingMemoryEntitySegment.h.

◆ removeAllEntities()

void removeAllEntities ( const ::Ice::Current &  c = Ice::emptyCurrent)
inlineoverride

Definition at line 331 of file WorkingMemoryEntitySegment.h.

+ Here is the caller graph for this function:

◆ removeEntity()

void removeEntity ( const ::std::string &  id,
const ::Ice::Current &  c = Ice::emptyCurrent 
)
inlineoverride

Definition at line 312 of file WorkingMemoryEntitySegment.h.

+ Here is the caller graph for this function:

◆ setEntityAttribute()

void setEntityAttribute ( const std::string &  entityId,
const EntityAttributeBasePtr &  attribute,
const ::Ice::Current &  c 
)
inlineoverride

Definition at line 336 of file WorkingMemoryEntitySegment.h.

◆ setEntityAttributes()

void setEntityAttributes ( const std::string &  entityId,
const EntityAttributeList &  attributeMap,
const ::Ice::Current &  c 
)
inlineoverride

Definition at line 349 of file WorkingMemoryEntitySegment.h.

◆ setListenerProxy()

void setListenerProxy ( const WorkingMemoryListenerInterfacePrx &  listenerProxy,
const ::Ice::Current &  c = Ice::emptyCurrent 
)
inlineoverrideprotected

Definition at line 642 of file WorkingMemoryEntitySegment.h.

◆ setParentMemory()

void setParentMemory ( const MemoryInterfacePtr &  memory,
const ::Ice::Current &  c 
)
inlineoverrideprotected

Definition at line 653 of file WorkingMemoryEntitySegment.h.

◆ setSegmentName()

void setSegmentName ( const std::string &  segmentName,
const ::Ice::Current &  c = Ice::emptyCurrent 
)
inlineoverrideprotected

Definition at line 648 of file WorkingMemoryEntitySegment.h.

◆ size()

Ice::Int size ( const ::Ice::Current &  c = Ice::emptyCurrent) const
inlineoverride

Definition at line 391 of file WorkingMemoryEntitySegment.h.

◆ updateEntity() [1/2]

void updateEntity ( const std::string &  entityId,
const EntityBasePtr &  update,
const ::Ice::Current &  c = Ice::emptyCurrent 
)
inlineoverride

Definition at line 246 of file WorkingMemoryEntitySegment.h.

+ Here is the caller graph for this function:

◆ updateEntity() [2/2]

void updateEntity ( const std::string &  entityId,
const EntityBasePtr &  update,
const Ice::StringSeq &  deactivatedFusionMethods,
const ::Ice::Current &  c = Ice::emptyCurrent 
)
inline

Definition at line 252 of file WorkingMemoryEntitySegment.h.

◆ updateEntityThreadUnsafe()

void updateEntityThreadUnsafe ( const std::string &  entityId,
const EntityBasePtr &  update,
const Ice::StringSeq &  deactivatedFusionMethods 
)
inlineprotected

Definition at line 259 of file WorkingMemoryEntitySegment.h.

◆ upsertEntity()

std::string upsertEntity ( const std::string &  entityId,
const EntityBasePtr &  newEntity,
const ::Ice::Current &  c = Ice::emptyCurrent 
)
inlineoverride

Definition at line 194 of file WorkingMemoryEntitySegment.h.

+ Here is the caller graph for this function:

◆ upsertEntityByName()

std::string upsertEntityByName ( const std::string &  entityName,
const EntityBasePtr &  newEntity,
const ::Ice::Current &  c = Ice::emptyCurrent 
)
inlineoverride

Definition at line 229 of file WorkingMemoryEntitySegment.h.

+ Here is the caller graph for this function:

◆ upsertEntityList()

EntityIdList upsertEntityList ( const EntityBaseList &  entityList,
const ::Ice::Current &  c 
)
inlineoverride

Definition at line 209 of file WorkingMemoryEntitySegment.h.

Friends And Related Function Documentation

◆ SegmentedMemory

friend class SegmentedMemory
friend

Definition at line 48 of file WorkingMemoryEntitySegment.h.

Member Data Documentation

◆ entityMap

IdEntityMap entityMap
protected

Definition at line 637 of file WorkingMemoryEntitySegment.h.

◆ fusionMethod

EntityFusionMethodPtr fusionMethod
protected

Definition at line 658 of file WorkingMemoryEntitySegment.h.

◆ lastEntityId

int lastEntityId
protected

Definition at line 638 of file WorkingMemoryEntitySegment.h.

◆ parentMemory

MemoryInterfacePtr parentMemory
protected

Definition at line 660 of file WorkingMemoryEntitySegment.h.

◆ segmentName

std::string segmentName
protected

Definition at line 659 of file WorkingMemoryEntitySegment.h.


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