Entity Class Reference

A memory storing data in mongodb (needs 'armarx memory start' to start the mongod instance) More...

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

+ Inheritance diagram for Entity:

Public Member Functions

 Entity (const std::string &exportName, const MemoryID &memoryId, const std::shared_ptr< Processors > &filters, const std::shared_ptr< persistence::MemoryPersistenceStrategy > &persistenceStrategy)
 
std::shared_ptr< EntitySnapshotfindFirstSnapshotAfter (const Time &time) const override
 
std::shared_ptr< EntitySnapshotfindFirstSnapshotAfterOrAt (const Time &time) const override
 
std::shared_ptr< EntitySnapshotfindLatestSnapshot () const override
 
std::shared_ptr< EntitySnapshotfindLatestSnapshotBefore (const Time &time) const override
 
std::shared_ptr< EntitySnapshotfindLatestSnapshotBeforeOrAt (const Time &time) const override
 
std::shared_ptr< EntitySnapshotfindSnapshot (const Time &snapshotTime) const override
 find entity snapshot segment More...
 
bool forEachSnapshot (std::function< void(EntitySnapshot &)> func) const override
 iterate over all entity snapshots of this ltm More...
 
bool forEachSnapshotBefore (const Time &time, std::function< void(EntitySnapshot &)> func) const override
 
bool forEachSnapshotBeforeOrAt (const Time &time, std::function< void(EntitySnapshot &)> func) const override
 
bool forEachSnapshotInIndexRange (long first, long last, std::function< void(EntitySnapshot &)> func) const override
 
bool forEachSnapshotInTimeRange (const Time &min, const Time &max, std::function< void(EntitySnapshot &)> func) const override
 
bool hasSnapshot (const Time &snapshotTime) const override
 check if snapshot segment exists More...
 
- Public Member Functions inherited from EntityBase< EntitySnapshot >
virtual std::shared_ptr< EntitySnapshotTfindLatestSnapshot () const=0
 
Statistics getStatistics () const
 
void loadAllReferences (armem::wm::Entity &e)
 return the full sub-ltm as a wm::Entity with only references the ltm may be huge, use with caution More...
 
void loadLatestNReferences (int n, armem::wm::Entity &e)
 
 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::Entity &e)
 convert the references of the input into a wm::Memory More...
 
void store (const armem::wm::Entity &e, bool simulatedVersion)
 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::Entity &wmEntity) override
 
void _loadLatestNReferences (int n, armem::wm::Entity &wmEntity) override
 
void _resolve (armem::wm::Entity &wmEntity) override
 
void _store (const armem::wm::Entity &wmEntity, bool simulatedVersion) override
 
- Protected Member Functions inherited from MemoryItem
virtual void _setExportName (const std::string &)
 
virtual void _setMemoryID (const MemoryID &)
 

Additional Inherited Members

- Public Types inherited from EntityBase< EntitySnapshot >
using EntitySnapshotT = EntitySnapshot
 
- Static Public Member Functions inherited from EntityBase< EntitySnapshot >
static std::string getLevelName ()
 
- Protected Attributes inherited from EntityBase< EntitySnapshot >
std::recursive_mutex ltm_mutex
 
Statistics statistics
 
- Protected Attributes inherited from MemoryItem
std::shared_ptr< Processorsprocessors
 

Detailed Description

A memory storing data in mongodb (needs 'armarx memory start' to start the mongod instance)

Definition at line 14 of file Entity.h.

Constructor & Destructor Documentation

◆ Entity()

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

Definition at line 20 of file Entity.cpp.

Member Function Documentation

◆ _loadAllReferences()

void _loadAllReferences ( armem::wm::Entity wmEntity)
overrideprotectedvirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 355 of file Entity.cpp.

+ Here is the call graph for this function:

◆ _loadLatestNReferences()

void _loadLatestNReferences ( int  n,
armem::wm::Entity wmEntity 
)
overrideprotectedvirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 378 of file Entity.cpp.

+ Here is the call graph for this function:

◆ _resolve()

void _resolve ( armem::wm::Entity wmEntity)
overrideprotectedvirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 420 of file Entity.cpp.

+ Here is the call graph for this function:

◆ _store()

void _store ( const armem::wm::Entity wmEntity,
bool  simulatedVersion 
)
overrideprotectedvirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 446 of file Entity.cpp.

+ Here is the call graph for this function:

◆ findFirstSnapshotAfter()

std::shared_ptr< EntitySnapshot > findFirstSnapshotAfter ( const Time time) const
overridevirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 290 of file Entity.cpp.

+ Here is the call graph for this function:

◆ findFirstSnapshotAfterOrAt()

std::shared_ptr< EntitySnapshot > findFirstSnapshotAfterOrAt ( const Time time) const
overridevirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 323 of file Entity.cpp.

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

◆ findLatestSnapshot()

std::shared_ptr< EntitySnapshot > findLatestSnapshot ( ) const
override

Definition at line 187 of file Entity.cpp.

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

◆ findLatestSnapshotBefore()

std::shared_ptr< EntitySnapshot > findLatestSnapshotBefore ( const Time time) const
overridevirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 222 of file Entity.cpp.

+ Here is the call graph for this function:

◆ findLatestSnapshotBeforeOrAt()

std::shared_ptr< EntitySnapshot > findLatestSnapshotBeforeOrAt ( const Time time) const
overridevirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 257 of file Entity.cpp.

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

◆ findSnapshot()

std::shared_ptr< EntitySnapshot > findSnapshot ( const Time ) const
overridevirtual

find entity snapshot segment

Implements EntityBase< EntitySnapshot >.

Definition at line 169 of file Entity.cpp.

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

◆ forEachSnapshot()

bool forEachSnapshot ( std::function< void(EntitySnapshot &)>  func) const
overridevirtual

iterate over all entity snapshots of this ltm

Implements EntityBase< EntitySnapshot >.

Definition at line 27 of file Entity.cpp.

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

◆ forEachSnapshotBefore()

bool forEachSnapshotBefore ( const Time time,
std::function< void(EntitySnapshot &)>  func 
) const
overridevirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 135 of file Entity.cpp.

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

◆ forEachSnapshotBeforeOrAt()

bool forEachSnapshotBeforeOrAt ( const Time time,
std::function< void(EntitySnapshot &)>  func 
) const
overridevirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 115 of file Entity.cpp.

+ Here is the call graph for this function:

◆ forEachSnapshotInIndexRange()

bool forEachSnapshotInIndexRange ( long  first,
long  last,
std::function< void(EntitySnapshot &)>  func 
) const
overridevirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 59 of file Entity.cpp.

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

◆ forEachSnapshotInTimeRange()

bool forEachSnapshotInTimeRange ( const Time min,
const Time max,
std::function< void(EntitySnapshot &)>  func 
) const
overridevirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 94 of file Entity.cpp.

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

◆ hasSnapshot()

bool hasSnapshot ( const Time ) const
overridevirtual

check if snapshot segment exists

Implements EntityBase< EntitySnapshot >.

Definition at line 154 of file Entity.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: