Go to the documentation of this file.
27 #include <MemoryX/interface/core/MemoryInterface.h>
28 #include <MemoryX/interface/components/CommonStorageInterface.h>
34 class MongoSerializer;
108 public virtual PersistentEntitySegmentBase,
117 void addReadCollection(
const CollectionInterfacePrx& coll, const ::Ice::Current& = Ice::emptyCurrent)
override;
119 void setWriteCollection(
const CollectionInterfacePrx& coll, const ::Ice::Current& = Ice::emptyCurrent)
override;
120 void setSingleRWCollection(
const CollectionInterfacePrx& coll, const ::Ice::Current& = Ice::emptyCurrent)
override;
122 std::string
getObjectTypeId(const ::Ice::Current& = Ice::emptyCurrent)
const override;
129 std::string
addEntity(
const EntityBasePtr& entity, const ::Ice::Current&
c = Ice::emptyCurrent)
override;
131 std::string
upsertEntity(
const std::string& entityId,
const EntityBasePtr& entity, const ::Ice::Current& = Ice::emptyCurrent)
override;
133 std::string
upsertEntityByName(
const std::string& entityName,
const EntityBasePtr& entity, const ::Ice::Current& = Ice::emptyCurrent)
override;
139 EntityIdList
addEntityList(
const EntityBaseList& entityList,
const Ice::Current& = Ice::emptyCurrent)
override;
142 EntityIdList
upsertEntityList(
const EntityBaseList& entityList,
const Ice::Current& = Ice::emptyCurrent)
override;
145 void updateEntity(const ::std::string& entityId,
const EntityBasePtr&
update, const ::Ice::Current& = Ice::emptyCurrent)
override;
152 void removeEntity(const ::std::string& entityId, const ::Ice::Current& = Ice::emptyCurrent)
override;
160 bool hasEntityById(
const std::string& entityId,
const Ice::Current& = Ice::emptyCurrent)
const override;
162 bool hasEntityByName(
const std::string& entityName,
const Ice::Current& = Ice::emptyCurrent)
const override;
165 EntityBasePtr
getEntityById(const ::std::string& entityId, const ::Ice::Current& = Ice::emptyCurrent)
const override;
167 EntityBasePtr
getEntityByName(const ::std::string& name, const ::Ice::Current& = Ice::emptyCurrent)
const override;
169 EntityBaseList
getEntitiesByAttrValue(const ::std::string& attrName, const ::std::string& attrValue, const ::Ice::Current& = Ice::emptyCurrent)
const override;
170 EntityBaseList
getEntitiesByAttrValueList(const ::std::string& attrName,
const NameList& attrValueList, const ::Ice::Current& = Ice::emptyCurrent)
const override;
171 EntityIdList
getAllEntityIds(const ::Ice::Current& = Ice::emptyCurrent)
const override;
177 EntityBaseList
getAllEntities(const ::Ice::Current& = Ice::emptyCurrent)
const override;
178 IdEntityMap
getIdEntityMap(const ::Ice::Current& = Ice::emptyCurrent)
const override;
184 Ice::Int size(const ::Ice::Current& = Ice::emptyCurrent)
const override;
185 void print(const ::Ice::Current& = Ice::emptyCurrent)
const override;
189 void clear(const ::Ice::Current& = Ice::emptyCurrent)
override;
192 std::string
getSegmentName(const ::Ice::Current& = Ice::emptyCurrent)
const override;
196 EntityRefBasePtr
getEntityRefById(
const std::string&
id,
const Ice::Current&)
const override;
197 EntityRefBasePtr
getEntityRefByName(
const std::string& name,
const Ice::Current&
c)
const override;
199 void setEntityAttribute(
const std::string& entityId,
const EntityAttributeBasePtr& attribute,
const Ice::Current&)
override;
200 void setEntityAttributes(
const std::string& entityId,
const EntityAttributeList& attributeMap,
const Ice::Current&)
override;
204 void setParentMemory(
const MemoryInterfacePtr& memory,
const Ice::Current&)
override;
215 EntityRefList
findRefsByQuery(
const std::string& query,
const Ice::Current&
c)
override;
void setSingleRWCollection(const CollectionInterfacePrx &coll, const ::Ice::Current &=Ice::emptyCurrent) override
NameList getReadCollectionsNS(const ::Ice::Current &=Ice::emptyCurrent) const override
IdEntityMap getIdEntityMap(const ::Ice::Current &=Ice::emptyCurrent) const override
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 create...
EntityRefList findRefsByQuery(const std::string &query, const Ice::Current &c) override
retrieves Entity Refs that match the query.
void setEntityAttributes(const std::string &entityId, const EntityAttributeList &attributeMap, const Ice::Current &) override
void updateEntity(const ::std::string &entityId, const EntityBasePtr &update, const ::Ice::Current &=Ice::emptyCurrent) override
std::recursive_mutex dbSerializerMutex
void setWriteCollection(const CollectionInterfacePrx &coll, const ::Ice::Current &=Ice::emptyCurrent) override
MemoryInterfacePtr parentMemory
void setParentMemory(const MemoryInterfacePtr &memory, const Ice::Current &) override
virtual void updateEntityThreadUnsafe(const ::std::string &entityId, const EntityBasePtr &update)
void print(const ::Ice::Current &=Ice::emptyCurrent) const override
std::string addEntity(const EntityBasePtr &entity, const ::Ice::Current &c=Ice::emptyCurrent) override
addEntity add new entity and return the newly generated entity ID
EntityRefBasePtr getEntityRefByName(const std::string &name, const Ice::Current &c) 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 segm...
std::string getObjectTypeId(const ::Ice::Current &=Ice::emptyCurrent) const override
virtual void removeEntityThreadUnsafe(const ::std::string &entityId)
Ice::Int size(const ::Ice::Current &=Ice::emptyCurrent) const override
size counts the number of memoryx::Entity instances contained available reachable throuhg memoryx::Pe...
std::string getSegmentName(const ::Ice::Current &=Ice::emptyCurrent) const override
virtual std::string addEntityThreadUnsafe(const EntityBasePtr &entity)
void setSegmentName(const std::string &segmentName, const ::Ice::Current &=Ice::emptyCurrent) override
EntityBaseList getAllEntities(const ::Ice::Current &=Ice::emptyCurrent) const override
getAllEntities returns a list of all entities managed by this memory segment
~PersistentEntitySegment() override
virtual EntityIdList getAllEntityIdsThreadUnsafe() const
CollectionInterfacePrx writeCollection
virtual std::string upsertEntityByNameThreadUnsafe(const std::string &entityName, const EntityBasePtr &entity)
PersistentEntitySegment(CollectionInterfacePrx entityCollection, Ice::CommunicatorPtr ic, bool useMongoIds=true)
virtual EntityBasePtr getEntityByNameThreadUnsafe(const ::std::string &name) const
void Identity(MatrixXX< N, N, T > *a)
EntityBasePtr getEntityById(const ::std::string &entityId, const ::Ice::Current &=Ice::emptyCurrent) const override
EntityBasePtr getEntityByName(const ::std::string &name, const ::Ice::Current &=Ice::emptyCurrent) const override
EntityRefBasePtr getEntityRefById(const std::string &id, const Ice::Current &) const override
EntityBasePtr deserializeEntity(const DBStorableData &dbEntity) const
virtual EntityIdList upsertEntityListThreadUnsafe(const EntityBaseList &entityList)
void addReadCollection(const CollectionInterfacePrx &coll, const ::Ice::Current &=Ice::emptyCurrent) override
virtual EntityBasePtr getEntityByIdThreadUnsafe(const ::std::string &entityId) const
std::string upsertEntity(const std::string &entityId, const EntityBasePtr &entity, const ::Ice::Current &=Ice::emptyCurrent) override
bool hasEntityByNameThreadUnsafe(const std::string &entityName) const
void setEntityAttribute(const std::string &entityId, const EntityAttributeBasePtr &attribute, const Ice::Current &) override
bool hasEntityByIdThreadUnsafe(const std::string &entityId) const
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
EntityIdList upsertEntityList(const EntityBaseList &entityList, const Ice::Current &=Ice::emptyCurrent) override
::Ice::Identity getIceId(const ::Ice::Current &=Ice::emptyCurrent) const override
virtual EntityIdList addEntityListThreadUnsafe(const EntityBaseList &entityList)
EntityBaseList getEntitiesByAttrValue(const ::std::string &attrName, const ::std::string &attrValue, const ::Ice::Current &=Ice::emptyCurrent) const override
void clear(const ::Ice::Current &=Ice::emptyCurrent) override
clear removes all elements from the current memoryx::PersistentEntitySegment::writeCollection
void removeEntity(const ::std::string &entityId, const ::Ice::Current &=Ice::emptyCurrent) override
removeEntity removes an entity with the ID entityId
bool hasEntityByName(const std::string &entityName, const Ice::Current &=Ice::emptyCurrent) const override
std::string upsertEntityByName(const std::string &entityName, const EntityBasePtr &entity, const ::Ice::Current &=Ice::emptyCurrent) override
void clearReadCollections(const ::Ice::Current &=Ice::emptyCurrent) override
The PersistentEntitySegment class is the base class for all memory segments containing memoryx::Entit...
IceUtil::Handle< MongoSerializer > MongoSerializerPtr
EntityIdList getAllEntityIds(const ::Ice::Current &=Ice::emptyCurrent) const override
EntityBaseList getEntitiesByAttrValueList(const ::std::string &attrName, const NameList &attrValueList, const ::Ice::Current &=Ice::emptyCurrent) const override
virtual std::string upsertEntityThreadUnsafe(const std::string &entityId, const EntityBasePtr &entity)
CollectionPrxList readCollections
MongoSerializerPtr dbSerializer
bool hasEntityById(const std::string &entityId, const Ice::Current &=Ice::emptyCurrent) const override
std::string getWriteCollectionNS(const ::Ice::Current &=Ice::emptyCurrent) const override