EntitySnapshot Class Reference

#include <RobotAPI/libraries/armem/server/ltm/EntitySnapshot.h>

+ Inheritance diagram for EntitySnapshot:

Public Member Functions

 EntitySnapshot (const std::string &exportName, const MemoryID &memoryId, const std::shared_ptr< Processors > &filters, const std::shared_ptr< persistence::MemoryPersistenceStrategy > &persistenceStrategy)
 
std::shared_ptr< EntityInstancefindInstance (const int entityInstanceIndex) const override
 find Instance segment More...
 
bool forEachInstance (std::function< void(EntityInstance &)> func) const override
 iterate over all Instance segments of this ltm More...
 
bool hasInstance (const int entityInstanceIndex) const override
 check if Instance segment exists More...
 
- Public Member Functions inherited from EntitySnapshotBase< EntityInstance >
Statistics getStatistics () const
 
void loadAllReferences (armem::wm::EntitySnapshot &e) const
 return the full sub-ltm as a wm::EntitySnapshot with only references the ltm may be huge, use with caution More...
 
 MemoryItem (const std::string &exportName, const MemoryID &)
 
 MemoryItem (const std::string &exportName, const MemoryID &, const std::shared_ptr< Processors > &)
 
void resetStatistics ()
 statistics More...
 
void resolve (armem::wm::EntitySnapshot &e) const
 convert the references of the input into a wm::Memory More...
 
void store (const armem::wm::EntitySnapshot &e)
 encode the content of a wm::Memory and store More...
 
- Public Member Functions inherited from MemoryItem
virtual std::string getExportName () const
 
MemoryID getMemoryID () const
 
MemoryID id () const
 
 MemoryItem (const std::string &exportName, const MemoryID &)
 
 MemoryItem (const std::string &exportName, const MemoryID &, const std::shared_ptr< Processors > &)
 
std::string name () const
 
void setExportName (const std::string &n)
 
void setMemoryID (const MemoryID &)
 
void setMemoryName (const std::string &memoryName)
 
virtual ~MemoryItem ()=default
 

Protected Member Functions

void _loadAllReferences (armem::wm::EntitySnapshot &wmEntitySnapshot) const override
 
void _resolve (armem::wm::EntitySnapshot &wmEntitySnapshot) const override
 
void _store (const armem::wm::EntitySnapshot &wmEntitySnapshot) override
 
- Protected Member Functions inherited from MemoryItem
virtual void _setExportName (const std::string &)
 
virtual void _setMemoryID (const MemoryID &)
 

Additional Inherited Members

- Static Public Member Functions inherited from EntitySnapshotBase< EntityInstance >
static std::string getLevelName ()
 
- Protected Attributes inherited from EntitySnapshotBase< EntityInstance >
std::recursive_mutex ltm_mutex
 
Statistics statistics
 
- Protected Attributes inherited from MemoryItem
std::shared_ptr< Processorsprocessors
 

Detailed Description

Definition at line 14 of file EntitySnapshot.h.

Constructor & Destructor Documentation

◆ EntitySnapshot()

EntitySnapshot ( const std::string &  exportName,
const MemoryID memoryId,
const std::shared_ptr< Processors > &  filters,
const std::shared_ptr< persistence::MemoryPersistenceStrategy > &  persistenceStrategy 
)

Definition at line 14 of file EntitySnapshot.cpp.

Member Function Documentation

◆ _loadAllReferences()

void _loadAllReferences ( armem::wm::EntitySnapshot wmEntitySnapshot) const
overrideprotectedvirtual

Implements EntitySnapshotBase< EntityInstance >.

Definition at line 74 of file EntitySnapshot.cpp.

+ Here is the call graph for this function:

◆ _resolve()

void _resolve ( armem::wm::EntitySnapshot wmEntitySnapshot) const
overrideprotectedvirtual

Implements EntitySnapshotBase< EntityInstance >.

Definition at line 86 of file EntitySnapshot.cpp.

+ Here is the call graph for this function:

◆ _store()

void _store ( const armem::wm::EntitySnapshot wmEntitySnapshot)
overrideprotectedvirtual

Implements EntitySnapshotBase< EntityInstance >.

Definition at line 112 of file EntitySnapshot.cpp.

+ Here is the call graph for this function:

◆ findInstance()

std::shared_ptr< EntityInstance > findInstance ( const int  ) const
overridevirtual

find Instance segment

Implements EntitySnapshotBase< EntityInstance >.

Definition at line 56 of file EntitySnapshot.cpp.

+ Here is the call graph for this function:

◆ forEachInstance()

bool forEachInstance ( std::function< void(EntityInstance &)>  func) const
overridevirtual

iterate over all Instance segments of this ltm

Implements EntitySnapshotBase< EntityInstance >.

Definition at line 22 of file EntitySnapshot.cpp.

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

◆ hasInstance()

bool hasInstance ( const int  ) const
overridevirtual

check if Instance segment exists

Implements EntitySnapshotBase< EntityInstance >.

Definition at line 46 of file EntitySnapshot.cpp.

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

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