PersistentObjectClassSegment Class Reference

The persistent object class segment is a specialized segment of the SegmentedMemory. More...

#include <MemoryX/libraries/memorytypes/segment/PersistentObjectClassSegment.h>

+ Inheritance diagram for PersistentObjectClassSegment:

Public Member Functions

ObjectComparisonResult compare (const ObjectClassBasePtr &objClass, const ObjectClassBasePtr &other, const Ice::Current &=Ice::emptyCurrent) const override
 Checks whether an object class is equal to another or if they contain an equal parent class. More...
 
ObjectClassList getAllParentClasses (const std::string &className, const ::Ice::Current &=Ice::emptyCurrent) const override
 Retrieves recursively all parent classes for an object class from the database. More...
 
ObjectClassList getChildClasses (const std::string &parentClassName, const ::Ice::Current &=Ice::emptyCurrent) const override
 Retrieve child classes of a class. More...
 
ObjectClassList getClassWithSubclasses (const std::string &rootClassName, const ::Ice::Current &=Ice::emptyCurrent) const override
 Retrieve class and all subclasses. More...
 
ObjectClassBasePtr getObjectClassById (const ::std::string &id, const ::Ice::Current &=Ice::emptyCurrent) const override
 Retrieve a persistent object class by id. More...
 
ObjectClassBasePtr getObjectClassByName (const ::std::string &name, const ::Ice::Current &=Ice::emptyCurrent) const override
 Retrieve a persistent object class by name. More...
 
ObjectClassBasePtr getObjectClassByNameWithAllParents (const ::std::string &name, const ::Ice::Current &=Ice::emptyCurrent) const override
 Retrieve a object class with all the parent classes, that means also the parent classes of the direct parent classes and so on. More...
 
ObjectClassList getParentClasses (const std::string &className, const ::Ice::Current &=Ice::emptyCurrent) const override
 Retrieve direct parent classes of a class. More...
 
bool isParentClass (const ::std::string &className, const ::std::string &parentCandidate, const ::Ice::Current &=Ice::emptyCurrent) const override
 
 PersistentObjectClassSegment (CollectionInterfacePrx entityCollection, Ice::CommunicatorPtr ic, bool useMongoIds=true)
 Creates a new peristent object class segment. More...
 
- Public Member Functions inherited from PersistentEntitySegment
std::string addEntity (const EntityBasePtr &entity, const ::Ice::Current &c=Ice::emptyCurrent) override
 addEntity add new entity and return the newly generated entity ID More...
 
EntityIdList addEntityList (const EntityBaseList &entityList, const Ice::Current &=Ice::emptyCurrent) override
 addEntityList adds all entities contained in \entityList to this segment and returns a list of created entity IDs More...
 
virtual EntityIdList addEntityListThreadUnsafe (const EntityBaseList &entityList)
 
virtual std::string addEntityThreadUnsafe (const EntityBasePtr &entity)
 
void addReadCollection (const CollectionInterfacePrx &coll, const ::Ice::Current &=Ice::emptyCurrent) override
 
void clear (const ::Ice::Current &=Ice::emptyCurrent) override
 clear removes all elements from the current memoryx::PersistentEntitySegment::writeCollection More...
 
void clearReadCollections (const ::Ice::Current &=Ice::emptyCurrent) override
 
EntityRefList findRefsByQuery (const std::string &query, const Ice::Current &c) override
 retrieves Entity Refs that match the query. More...
 
EntityBaseList getAllEntities (const ::Ice::Current &=Ice::emptyCurrent) const override
 getAllEntities returns a list of all entities managed by this memory segment More...
 
EntityIdList getAllEntityIds (const ::Ice::Current &=Ice::emptyCurrent) const override
 
virtual EntityIdList getAllEntityIdsThreadUnsafe () const
 
EntityBaseList getEntitiesByAttrValue (const ::std::string &attrName, const ::std::string &attrValue, const ::Ice::Current &=Ice::emptyCurrent) const override
 
EntityBaseList getEntitiesByAttrValueList (const ::std::string &attrName, const NameList &attrValueList, const ::Ice::Current &=Ice::emptyCurrent) const override
 
EntityBasePtr getEntityById (const ::std::string &entityId, const ::Ice::Current &=Ice::emptyCurrent) const override
 
virtual EntityBasePtr getEntityByIdThreadUnsafe (const ::std::string &entityId) const
 
EntityBasePtr getEntityByName (const ::std::string &name, const ::Ice::Current &=Ice::emptyCurrent) const override
 
virtual EntityBasePtr getEntityByNameThreadUnsafe (const ::std::string &name) const
 
EntityRefBasePtr getEntityRefById (const std::string &id, const Ice::Current &) const override
 
EntityRefBasePtr getEntityRefByName (const std::string &name, const Ice::Current &c) const override
 
::Ice::Identity getIceId (const ::Ice::Current &=Ice::emptyCurrent) const override
 
IdEntityMap getIdEntityMap (const ::Ice::Current &=Ice::emptyCurrent) const override
 
std::string getObjectTypeId (const ::Ice::Current &=Ice::emptyCurrent) const override
 
NameList getReadCollectionsNS (const ::Ice::Current &=Ice::emptyCurrent) const override
 
std::string getSegmentName (const ::Ice::Current &=Ice::emptyCurrent) const override
 
std::string getWriteCollectionNS (const ::Ice::Current &=Ice::emptyCurrent) const override
 
bool hasEntityById (const std::string &entityId, const Ice::Current &=Ice::emptyCurrent) const override
 
bool hasEntityByIdThreadUnsafe (const std::string &entityId) const
 
bool hasEntityByName (const std::string &entityName, const Ice::Current &=Ice::emptyCurrent) const override
 
bool hasEntityByNameThreadUnsafe (const std::string &entityName) const
 
 PersistentEntitySegment (CollectionInterfacePrx entityCollection, Ice::CommunicatorPtr ic, bool useMongoIds=true)
 
void print (const ::Ice::Current &=Ice::emptyCurrent) const override
 
void removeAllEntities (const ::Ice::Current &c=Ice::emptyCurrent) override
 removeAllEntities collects all entities managed by this memory segment and removes them from the segment More...
 
void removeEntity (const ::std::string &entityId, const ::Ice::Current &=Ice::emptyCurrent) override
 removeEntity removes an entity with the ID entityId More...
 
virtual void removeEntityThreadUnsafe (const ::std::string &entityId)
 
void setEntityAttribute (const std::string &entityId, const EntityAttributeBasePtr &attribute, const Ice::Current &) override
 
void setEntityAttributes (const std::string &entityId, const EntityAttributeList &attributeMap, const Ice::Current &) override
 
void setParentMemory (const MemoryInterfacePtr &memory, const Ice::Current &) override
 
void setSingleRWCollection (const CollectionInterfacePrx &coll, const ::Ice::Current &=Ice::emptyCurrent) override
 
void setWriteCollection (const CollectionInterfacePrx &coll, const ::Ice::Current &=Ice::emptyCurrent) override
 
Ice::Int size (const ::Ice::Current &=Ice::emptyCurrent) const override
 size counts the number of memoryx::Entity instances contained available reachable throuhg memoryx::PersistentEntitySegment::readCollections. More...
 
void updateEntity (const ::std::string &entityId, const EntityBasePtr &update, const ::Ice::Current &=Ice::emptyCurrent) override
 
virtual void updateEntityThreadUnsafe (const ::std::string &entityId, const EntityBasePtr &update)
 
std::string upsertEntity (const std::string &entityId, const EntityBasePtr &entity, const ::Ice::Current &=Ice::emptyCurrent) override
 
std::string upsertEntityByName (const std::string &entityName, const EntityBasePtr &entity, const ::Ice::Current &=Ice::emptyCurrent) override
 
virtual std::string upsertEntityByNameThreadUnsafe (const std::string &entityName, const EntityBasePtr &entity)
 
EntityIdList upsertEntityList (const EntityBaseList &entityList, const Ice::Current &=Ice::emptyCurrent) override
 
virtual EntityIdList upsertEntityListThreadUnsafe (const EntityBaseList &entityList)
 
virtual std::string upsertEntityThreadUnsafe (const std::string &entityId, const EntityBasePtr &entity)
 
 ~PersistentEntitySegment () override
 
- 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
 

Static Public Member Functions

static void unique (ObjectClassList &classes)
 

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 >
 
- Protected Member Functions inherited from PersistentEntitySegment
EntityBasePtr deserializeEntity (const DBStorableData &dbEntity) const
 
void setSegmentName (const std::string &segmentName, const ::Ice::Current &=Ice::emptyCurrent) override
 
- Protected Member Functions inherited from SegmentUtilImplementations
void keepAliveCheck ()
 
- Protected Attributes inherited from PersistentEntitySegment
MongoSerializerPtr dbSerializer
 
std::recursive_mutex dbSerializerMutex
 
MemoryInterfacePtr parentMemory
 
CollectionPrxList readCollections
 
std::string segmentName
 
bool useMongoIds
 
CollectionInterfacePrx writeCollection
 
- 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
 

Detailed Description

The persistent object class segment is a specialized segment of the SegmentedMemory.

It keeps object classes which are held in prior knowledge (MongoDB) and thus are persistent. This segment is usually part of the prior knowledge memory.

Definition at line 43 of file PersistentObjectClassSegment.h.

Constructor & Destructor Documentation

◆ PersistentObjectClassSegment()

PersistentObjectClassSegment ( CollectionInterfacePrx  entityCollection,
Ice::CommunicatorPtr  ic,
bool  useMongoIds = true 
)
inline

Creates a new peristent object class segment.

Parameters
entityCollectiona proxy to the collection from commonstorage
icice communicator
useMongoIdswhether to use entity IDs stored in MongoDB or internal ids

Definition at line 55 of file PersistentObjectClassSegment.h.

Member Function Documentation

◆ compare()

ObjectComparisonResult compare ( const ObjectClassBasePtr &  objClass,
const ObjectClassBasePtr &  other,
const Ice::Current &  = Ice::emptyCurrent 
) const
inlineoverride

Checks whether an object class is equal to another or if they contain an equal parent class.

Parameters
objClass
other
Returns

Definition at line 274 of file PersistentObjectClassSegment.h.

◆ getAllParentClasses()

ObjectClassList getAllParentClasses ( const std::string &  className,
const ::Ice::Current &  = Ice::emptyCurrent 
) const
inlineoverride

Retrieves recursively all parent classes for an object class from the database.

Parameters
classNameName of object class for which the parents should be calculated.
Returns
List of parent objects

Definition at line 227 of file PersistentObjectClassSegment.h.

◆ getChildClasses()

ObjectClassList getChildClasses ( const std::string &  parentClassName,
const ::Ice::Current &  = Ice::emptyCurrent 
) const
inlineoverride

Retrieve child classes of a class.

Parameters
parentClassNamename of the parent
Returns
list of child object classes

Definition at line 119 of file PersistentObjectClassSegment.h.

◆ getClassWithSubclasses()

ObjectClassList getClassWithSubclasses ( const std::string &  rootClassName,
const ::Ice::Current &  = Ice::emptyCurrent 
) const
inlineoverride

Retrieve class and all subclasses.

Retrieves a complete ontological subtree from the class prior knowledge.

Parameters
rootClassNamename of the root class
Returns
list of object classes in the subtree

Definition at line 186 of file PersistentObjectClassSegment.h.

◆ getObjectClassById()

ObjectClassBasePtr getObjectClassById ( const ::std::string &  id,
const ::Ice::Current &  = Ice::emptyCurrent 
) const
inlineoverride

Retrieve a persistent object class by id.

Parameters
ideither mongoId (if useMongIds) or internal id
Returns
pointer to object class on success

Definition at line 67 of file PersistentObjectClassSegment.h.

◆ getObjectClassByName()

ObjectClassBasePtr getObjectClassByName ( const ::std::string &  name,
const ::Ice::Current &  = Ice::emptyCurrent 
) const
inlineoverride

Retrieve a persistent object class by name.

Parameters
namename of object class
Returns
pointer to object class on success

Definition at line 78 of file PersistentObjectClassSegment.h.

◆ getObjectClassByNameWithAllParents()

ObjectClassBasePtr getObjectClassByNameWithAllParents ( const ::std::string &  name,
const ::Ice::Current &  = Ice::emptyCurrent 
) const
inlineoverride

Retrieve a object class with all the parent classes, that means also the parent classes of the direct parent classes and so on.

Parameters
nameName of the object class to retrieve
Returns
pointer to the object class

Definition at line 89 of file PersistentObjectClassSegment.h.

◆ getParentClasses()

ObjectClassList getParentClasses ( const std::string &  className,
const ::Ice::Current &  = Ice::emptyCurrent 
) const
inlineoverride

Retrieve direct parent classes of a class.

Parameters
parentClassNamename of the parent
Returns
list of child object classes

Definition at line 138 of file PersistentObjectClassSegment.h.

◆ isParentClass()

bool isParentClass ( const ::std::string &  className,
const ::std::string &  parentCandidate,
const ::Ice::Current &  = Ice::emptyCurrent 
) const
inlineoverride

Definition at line 312 of file PersistentObjectClassSegment.h.

◆ unique()

static void unique ( ObjectClassList &  classes)
inlinestatic

Definition at line 327 of file PersistentObjectClassSegment.h.


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