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)
 
- Public Member Functions inherited from EntityBase< EntitySnapshot >
std::shared_ptr< EntitySnapshotTfindFirstSnapshotAfter (const Time &time) const
 
std::shared_ptr< EntitySnapshotTfindFirstSnapshotAfterOrAt (const Time &time) const
 
std::shared_ptr< EntitySnapshotTfindLatestSnapshot () const
 
std::shared_ptr< EntitySnapshotTfindLatestSnapshotBefore (const Time &time) const
 
std::shared_ptr< EntitySnapshotTfindLatestSnapshotBeforeOrAt (const Time &time) const
 
std::shared_ptr< EntitySnapshotTfindSnapshot (const Time &time) const
 find entity snapshot segment
 
bool forEachSnapshot (std::function< void(EntitySnapshotT &)> func) const
 iterate over all entity snapshots of this ltm
 
bool forEachSnapshotBefore (const Time &time, std::function< void(EntitySnapshotT &)> func) const
 
bool forEachSnapshotBeforeOrAt (const Time &time, std::function< void(EntitySnapshotT &)> func) const
 
bool forEachSnapshotBeforeReverse (const Time &time, std::function< bool(EntitySnapshotT &)> func) const
 
bool forEachSnapshotInIndexRange (long first, long last, std::function< void(EntitySnapshotT &)> func) const
 
bool forEachSnapshotInTimeRange (const Time &min, const Time &max, std::function< void(EntitySnapshotT &)> func) const
 
Statistics getStatistics () const
 
bool hasSnapshot (const Time &time) const
 check if snapshot segment exists
 
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
 
void loadLatestNReferences (int n, armem::wm::Entity &e)
 
 MemoryItem (const std::string &exportName, const MemoryID &)
 
 MemoryItem (const std::string &exportName, const MemoryID &)
 
 MemoryItem (const std::string &exportName, const MemoryID &, const std::shared_ptr< Processors > &)
 
 MemoryItem (const std::string &exportName, const MemoryID &, const std::shared_ptr< Processors > &)
 
void resetStatistics ()
 statistics
 
void resolve (armem::wm::Entity &e)
 convert the references of the input into a wm::Memory
 
void store (const armem::wm::Entity &e, bool simulatedVersion)
 encode the content of a wm::Memory and store
 
- 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

std::shared_ptr< EntitySnapshot_implFindFirstSnapshotAfter (const Time &time) const override
 
std::shared_ptr< EntitySnapshot_implFindFirstSnapshotAfterOrAt (const Time &time) const override
 
std::shared_ptr< EntitySnapshot_implFindLatestSnapshot () const override
 
std::shared_ptr< EntitySnapshot_implFindLatestSnapshotBefore (const Time &time) const override
 
std::shared_ptr< EntitySnapshot_implFindLatestSnapshotBeforeOrAt (const Time &time) const override
 
std::shared_ptr< EntitySnapshot_implFindSnapshot (const Time &snapshotTime) const override
 
bool _implForEachSnapshot (std::function< void(EntitySnapshot &)> func) const override
 
bool _implForEachSnapshotBefore (const Time &time, std::function< void(EntitySnapshot &)> func) const override
 
bool _implForEachSnapshotBeforeOrAt (const Time &time, std::function< void(EntitySnapshot &)> func) const override
 
bool _implForEachSnapshotBeforeReverse (const Time &time, std::function< bool(EntitySnapshot &)> func) const override
 
bool _implForEachSnapshotInIndexRange (long first, long last, std::function< void(EntitySnapshot &)> func) const override
 
bool _implForEachSnapshotInTimeRange (const Time &min, const Time &max, std::function< void(EntitySnapshot &)> func) const override
 
bool _implHasSnapshot (const Time &snapshotTime) const override
 
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
 
- Static Public Member Functions inherited from EntityBase< EntitySnapshot >
static std::string getLevelName ()
 
- Protected Attributes inherited from EntityBase< EntitySnapshot >
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

◆ _implFindFirstSnapshotAfter()

std::shared_ptr< EntitySnapshot > _implFindFirstSnapshotAfter ( const Time & time) const
overrideprotectedvirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 312 of file Entity.cpp.

+ Here is the call graph for this function:

◆ _implFindFirstSnapshotAfterOrAt()

std::shared_ptr< EntitySnapshot > _implFindFirstSnapshotAfterOrAt ( const Time & time) const
overrideprotectedvirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 343 of file Entity.cpp.

+ Here is the call graph for this function:

◆ _implFindLatestSnapshot()

std::shared_ptr< EntitySnapshot > _implFindLatestSnapshot ( ) const
overrideprotectedvirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 215 of file Entity.cpp.

+ Here is the call graph for this function:

◆ _implFindLatestSnapshotBefore()

std::shared_ptr< EntitySnapshot > _implFindLatestSnapshotBefore ( const Time & time) const
overrideprotectedvirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 248 of file Entity.cpp.

+ Here is the call graph for this function:

◆ _implFindLatestSnapshotBeforeOrAt()

std::shared_ptr< EntitySnapshot > _implFindLatestSnapshotBeforeOrAt ( const Time & time) const
overrideprotectedvirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 281 of file Entity.cpp.

+ Here is the call graph for this function:

◆ _implFindSnapshot()

std::shared_ptr< EntitySnapshot > _implFindSnapshot ( const Time & snapshotTime) const
overrideprotectedvirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 199 of file Entity.cpp.

+ Here is the call graph for this function:

◆ _implForEachSnapshot()

bool _implForEachSnapshot ( std::function< void(EntitySnapshot &)> func) const
overrideprotectedvirtual

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:

◆ _implForEachSnapshotBefore()

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

Implements EntityBase< EntitySnapshot >.

Definition at line 127 of file Entity.cpp.

+ Here is the call graph for this function:

◆ _implForEachSnapshotBeforeOrAt()

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

Implements EntityBase< EntitySnapshot >.

Definition at line 109 of file Entity.cpp.

+ Here is the call graph for this function:

◆ _implForEachSnapshotBeforeReverse()

bool _implForEachSnapshotBeforeReverse ( const Time & time,
std::function< bool(EntitySnapshot &)> func ) const
overrideprotectedvirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 144 of file Entity.cpp.

+ Here is the call graph for this function:

◆ _implForEachSnapshotInIndexRange()

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

Implements EntityBase< EntitySnapshot >.

Definition at line 57 of file Entity.cpp.

+ Here is the call graph for this function:

◆ _implForEachSnapshotInTimeRange()

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

Implements EntityBase< EntitySnapshot >.

Definition at line 90 of file Entity.cpp.

+ Here is the call graph for this function:

◆ _implHasSnapshot()

bool _implHasSnapshot ( const Time & snapshotTime) const
overrideprotectedvirtual

Implements EntityBase< EntitySnapshot >.

Definition at line 186 of file Entity.cpp.

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

◆ _loadAllReferences()

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

Implements EntityBase< EntitySnapshot >.

Definition at line 373 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 394 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 434 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 458 of file Entity.cpp.

+ Here is the call graph for this function:

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