EntitySnapshotBase< _EntityInstanceT, _Derived > Class Template Reference

Data of an entity at one point in time. More...

#include <RobotAPI/libraries/armem/core/base/EntitySnapshotBase.h>

+ Inheritance diagram for EntitySnapshotBase< _EntityInstanceT, _Derived >:

Public Types

using EntityInstanceT = _EntityInstanceT
 
- Public Types inherited from MemoryContainerBase< std::vector< _EntityInstanceT >, _Derived >
using ContainerT = std::vector< _EntityInstanceT >
 
using DerivedT = _Derived
 

Public Member Functions

EntityInstanceTaddInstance ()
 
EntityInstanceTaddInstance (const EntityInstanceT &instance)
 Add a single instance with data. More...
 
EntityInstanceTaddInstance (EntityInstanceT &&instance)
 
 EntitySnapshotBase ()
 
 EntitySnapshotBase (const EntitySnapshotBase &other)=default
 
 EntitySnapshotBase (const MemoryID &id)
 
 EntitySnapshotBase (EntitySnapshotBase &&other)=default
 
 EntitySnapshotBase (Time time, const MemoryID &parentID={})
 
bool equalsDeep (const DerivedT &other) const
 
EntityInstanceTfindInstance (const MemoryID &instanceID)
 
const EntityInstanceTfindInstance (const MemoryID &instanceID) const
 
EntityInstanceTfindInstance (int index)
 
const EntityInstanceTfindInstance (int index) const
 
template<class InstanceFunctionT >
bool forEachInstance (InstanceFunctionT &&func)
 
template<class InstanceFunctionT >
bool forEachInstance (InstanceFunctionT &&func) const
 
template<class InstanceFunctionT >
bool forEachInstanceIn (const MemoryID &id, InstanceFunctionT &&func)
 
template<class InstanceFunctionT >
bool forEachInstanceIn (const MemoryID &id, InstanceFunctionT &&func) const
 
EntityInstanceTgetInstance (const MemoryID &instanceID)
 Get the given instance. More...
 
const EntityInstanceTgetInstance (const MemoryID &instanceID) const
 
EntityInstanceTgetInstance (int index)
 Get the given instance. More...
 
const EntityInstanceTgetInstance (int index) const
 
std::vector< int > getInstanceIndices () const
 
std::string getKeyString () const
 
bool hasInstance (const MemoryID &instanceID) const
 
bool hasInstance (int index) const
 
bool hasInstances () const
 Indicate whether this snapshot has any instances. More...
 
EntitySnapshotBaseoperator= (const EntitySnapshotBase &other)=default
 
EntitySnapshotBaseoperator= (EntitySnapshotBase &&other)=default
 
Timetime ()
 
const Timetime () const
 
void update (const EntityUpdate &update)
 
- Public Member Functions inherited from MemoryContainerBase< std::vector< _EntityInstanceT >, _Derived >
ContainerT::iterator begin ()
 
ContainerT::const_iterator begin () const
 
void clear ()
 
bool empty () const
 
ContainerT::iterator end ()
 
ContainerT::const_iterator end () const
 
bool forEachChild (ChildFunctionT &&func)
 
bool forEachChild (ChildFunctionT &&func) const
 
 MemoryContainerBase ()
 
 MemoryContainerBase (const MemoryContainerBase &other)=default
 
 MemoryContainerBase (const MemoryID &id)
 
 MemoryContainerBase (MemoryContainerBase &&other)=default
 
MemoryContainerBaseoperator= (const MemoryContainerBase &other)=default
 
MemoryContainerBaseoperator= (MemoryContainerBase &&other)=default
 
std::size_t size () const
 
- Public Member Functions inherited from MemoryItem
MemoryIDid ()
 
const MemoryIDid () const
 
 MemoryItem ()
 
 MemoryItem (const MemoryID &id)
 
 MemoryItem (const MemoryItem &other)=default
 
 MemoryItem (MemoryItem &&other)=default
 
MemoryItemoperator= (const MemoryItem &other)=default
 
MemoryItemoperator= (MemoryItem &&other)=default
 

Static Public Member Functions

static std::string getLevelName ()
 

Additional Inherited Members

- Protected Member Functions inherited from MemoryContainerBase< std::vector< _EntityInstanceT >, _Derived >
ChildT & _addChild (const KeyT &key, ChildArgs... childArgs)
 
void _checkContainerName (const std::string &gottenName, const std::string &actualName, bool emptyOk=true) const
 
DerivedT_derived ()
 
const DerivedT_derived () const
 
ContainerTcontainer ()
 
const ContainerTcontainer () const
 
- Protected Member Functions inherited from MemoryItem
 ~MemoryItem ()
 
- Protected Attributes inherited from MemoryContainerBase< std::vector< _EntityInstanceT >, _Derived >
ContainerT _container
 
- Protected Attributes inherited from MemoryItem
MemoryID _id
 

Detailed Description

template<class _EntityInstanceT, class _Derived>
class armarx::armem::base::EntitySnapshotBase< _EntityInstanceT, _Derived >

Data of an entity at one point in time.

Definition at line 24 of file EntitySnapshotBase.h.

Member Typedef Documentation

◆ EntityInstanceT

using EntityInstanceT = _EntityInstanceT

Definition at line 33 of file EntitySnapshotBase.h.

Constructor & Destructor Documentation

◆ EntitySnapshotBase() [1/5]

EntitySnapshotBase ( )
inline

Definition at line 37 of file EntitySnapshotBase.h.

◆ EntitySnapshotBase() [2/5]

EntitySnapshotBase ( Time  time,
const MemoryID parentID = {} 
)
inlineexplicit

Definition at line 41 of file EntitySnapshotBase.h.

◆ EntitySnapshotBase() [3/5]

EntitySnapshotBase ( const MemoryID id)
inlineexplicit

Definition at line 46 of file EntitySnapshotBase.h.

◆ EntitySnapshotBase() [4/5]

EntitySnapshotBase ( const EntitySnapshotBase< _EntityInstanceT, _Derived > &  other)
default

◆ EntitySnapshotBase() [5/5]

EntitySnapshotBase ( EntitySnapshotBase< _EntityInstanceT, _Derived > &&  other)
default

Member Function Documentation

◆ addInstance() [1/3]

EntityInstanceT& addInstance ( )
inline

Definition at line 288 of file EntitySnapshotBase.h.

+ Here is the caller graph for this function:

◆ addInstance() [2/3]

EntityInstanceT& addInstance ( const EntityInstanceT instance)
inline

Add a single instance with data.

Parameters
instanceThe instance.
Returns
The stored instance.
Exceptions
<tt>armem::error::InvalidArgument</tt>If the given index is invalid. Must be equal to container.size() or -1 (meaning push_back)

Definition at line 264 of file EntitySnapshotBase.h.

+ Here is the caller graph for this function:

◆ addInstance() [3/3]

EntityInstanceT& addInstance ( EntityInstanceT &&  instance)
inline

Definition at line 270 of file EntitySnapshotBase.h.

◆ equalsDeep()

bool equalsDeep ( const DerivedT other) const
inline

Definition at line 300 of file EntitySnapshotBase.h.

◆ findInstance() [1/4]

EntityInstanceT* findInstance ( const MemoryID instanceID)
inline

Definition at line 136 of file EntitySnapshotBase.h.

◆ findInstance() [2/4]

const EntityInstanceT* findInstance ( const MemoryID instanceID) const
inline

Definition at line 143 of file EntitySnapshotBase.h.

◆ findInstance() [3/4]

EntityInstanceT* findInstance ( int  index)
inline

Definition at line 93 of file EntitySnapshotBase.h.

+ Here is the caller graph for this function:

◆ findInstance() [4/4]

const EntityInstanceT* findInstance ( int  index) const
inline

Definition at line 100 of file EntitySnapshotBase.h.

◆ forEachInstance() [1/2]

bool forEachInstance ( InstanceFunctionT &&  func)
inline
Parameters
funcFunction like void process(EntityInstanceT& instance)>

Definition at line 178 of file EntitySnapshotBase.h.

+ Here is the caller graph for this function:

◆ forEachInstance() [2/2]

bool forEachInstance ( InstanceFunctionT &&  func) const
inline
Parameters
funcFunction like void process (const EntityInstanceT& instance)

Definition at line 188 of file EntitySnapshotBase.h.

◆ forEachInstanceIn() [1/2]

bool forEachInstanceIn ( const MemoryID id,
InstanceFunctionT &&  func 
)
inline
Parameters
funcFunction like void process(EntityInstanceT& instance)>

Definition at line 198 of file EntitySnapshotBase.h.

◆ forEachInstanceIn() [2/2]

bool forEachInstanceIn ( const MemoryID id,
InstanceFunctionT &&  func 
) const
inline
Parameters
funcFunction like void process (const EntityInstanceT& instance)

Definition at line 216 of file EntitySnapshotBase.h.

◆ getInstance() [1/4]

EntityInstanceT& getInstance ( const MemoryID instanceID)
inline

Get the given instance.

Parameters
indexThe instance's index.
Returns
The instance.
Exceptions
<tt>armem::error::MissingEntry</tt>If the given index is invalid.
<tt>armem::error::InvalidMemoryID</tt>If memory ID does not have an instance index.

Definition at line 158 of file EntitySnapshotBase.h.

◆ getInstance() [2/4]

const EntityInstanceT& getInstance ( const MemoryID instanceID) const
inline

Definition at line 165 of file EntitySnapshotBase.h.

◆ getInstance() [3/4]

EntityInstanceT& getInstance ( int  index)
inline

Get the given instance.

Parameters
indexThe instance's index.
Returns
The instance.
Exceptions
<tt>armem::error::MissingEntry</tt>If the given index is invalid.

Definition at line 114 of file EntitySnapshotBase.h.

+ Here is the caller graph for this function:

◆ getInstance() [4/4]

const EntityInstanceT& getInstance ( int  index) const
inline

Definition at line 121 of file EntitySnapshotBase.h.

◆ getInstanceIndices()

std::vector<int> getInstanceIndices ( ) const
inline

Definition at line 231 of file EntitySnapshotBase.h.

+ Here is the caller graph for this function:

◆ getKeyString()

std::string getKeyString ( ) const
inline

Definition at line 320 of file EntitySnapshotBase.h.

◆ getLevelName()

static std::string getLevelName ( )
inlinestatic

Definition at line 326 of file EntitySnapshotBase.h.

◆ hasInstance() [1/2]

bool hasInstance ( const MemoryID instanceID) const
inline

Definition at line 86 of file EntitySnapshotBase.h.

◆ hasInstance() [2/2]

bool hasInstance ( int  index) const
inline

Definition at line 79 of file EntitySnapshotBase.h.

◆ hasInstances()

bool hasInstances ( ) const
inline

Indicate whether this snapshot has any instances.

Definition at line 72 of file EntitySnapshotBase.h.

◆ operator=() [1/2]

EntitySnapshotBase& operator= ( const EntitySnapshotBase< _EntityInstanceT, _Derived > &  other)
default

◆ operator=() [2/2]

EntitySnapshotBase& operator= ( EntitySnapshotBase< _EntityInstanceT, _Derived > &&  other)
default

◆ time() [1/2]

Time& time ( )
inline

Definition at line 59 of file EntitySnapshotBase.h.

+ Here is the caller graph for this function:

◆ time() [2/2]

const Time& time ( ) const
inline

Definition at line 65 of file EntitySnapshotBase.h.

◆ update()

void update ( const EntityUpdate update)
inline

Definition at line 245 of file EntitySnapshotBase.h.

+ Here is the caller graph for this function:

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