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
 
using DerivedT
 

Public Member Functions

EntityInstanceTaddInstance ()
 
EntityInstanceTaddInstance (const EntityInstanceT &instance)
 Add a single instance with data.
 
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.
 
const EntityInstanceTgetInstance (const MemoryID &instanceID) const
 
EntityInstanceTgetInstance (int index)
 Get the given instance.
 
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.
 
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::iterator begin ()
 
ContainerT::const_iterator begin () const
 
ContainerT::const_iterator begin () const
 
void clear ()
 
void clear ()
 
bool empty () const
 
bool empty () const
 
ContainerT::iterator end ()
 
ContainerT::iterator end ()
 
ContainerT::const_iterator end () const
 
ContainerT::const_iterator end () const
 
bool forEachChild (ChildFunctionT &&func)
 
bool forEachChild (ChildFunctionT &&func)
 
bool forEachChild (ChildFunctionT &&func) const
 
bool forEachChild (ChildFunctionT &&func) const
 
 MemoryContainerBase ()
 
 MemoryContainerBase ()
 
 MemoryContainerBase (const MemoryContainerBase &other)=default
 
 MemoryContainerBase (const MemoryContainerBase &other)=default
 
 MemoryContainerBase (const MemoryID &id)
 
 MemoryContainerBase (const MemoryID &id)
 
 MemoryContainerBase (MemoryContainerBase &&other)=default
 
 MemoryContainerBase (MemoryContainerBase &&other)=default
 
MemoryContainerBaseoperator= (const MemoryContainerBase &other)=default
 
MemoryContainerBaseoperator= (const MemoryContainerBase &other)=default
 
MemoryContainerBaseoperator= (MemoryContainerBase &&other)=default
 
MemoryContainerBaseoperator= (MemoryContainerBase &&other)=default
 
std::size_t size () const
 
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)
 
ChildT & _addChild (const KeyT &key, ChildArgs... childArgs)
 
void _checkContainerName (const std::string &gottenName, const std::string &actualName, bool emptyOk=true) const
 
void _checkContainerName (const std::string &gottenName, const std::string &actualName, bool emptyOk=true) const
 
DerivedT_derived ()
 
DerivedT_derived ()
 
const DerivedT_derived () const
 
const DerivedT_derived () const
 
ContainerTcontainer ()
 
ContainerTcontainer ()
 
const ContainerTcontainer () const
 
const ContainerTcontainer () const
 
- Protected Member Functions inherited from MemoryItem
 ~MemoryItem ()
 
- Protected Attributes inherited from MemoryContainerBase< std::vector< _EntityInstanceT >, _Derived >
ContainerT _container
 
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

template<class _EntityInstanceT, class _Derived>
using EntityInstanceT = _EntityInstanceT

Definition at line 33 of file EntitySnapshotBase.h.

Constructor & Destructor Documentation

◆ EntitySnapshotBase() [1/5]

template<class _EntityInstanceT, class _Derived>
EntitySnapshotBase ( )
inline

Definition at line 37 of file EntitySnapshotBase.h.

+ Here is the caller graph for this function:

◆ EntitySnapshotBase() [2/5]

template<class _EntityInstanceT, class _Derived>
EntitySnapshotBase ( Time time,
const MemoryID & parentID = {} )
inlineexplicit

Definition at line 41 of file EntitySnapshotBase.h.

+ Here is the call graph for this function:

◆ EntitySnapshotBase() [3/5]

template<class _EntityInstanceT, class _Derived>
EntitySnapshotBase ( const MemoryID & id)
inlineexplicit

Definition at line 46 of file EntitySnapshotBase.h.

+ Here is the call graph for this function:

◆ EntitySnapshotBase() [4/5]

template<class _EntityInstanceT, class _Derived>
EntitySnapshotBase ( const EntitySnapshotBase< _EntityInstanceT, _Derived > & other)
default
+ Here is the call graph for this function:

◆ EntitySnapshotBase() [5/5]

template<class _EntityInstanceT, class _Derived>
EntitySnapshotBase ( EntitySnapshotBase< _EntityInstanceT, _Derived > && other)
default
+ Here is the call graph for this function:

Member Function Documentation

◆ addInstance() [1/3]

template<class _EntityInstanceT, class _Derived>
EntityInstanceT & addInstance ( )
inline

Definition at line 289 of file EntitySnapshotBase.h.

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

◆ addInstance() [2/3]

template<class _EntityInstanceT, class _Derived>
EntityInstanceT & addInstance ( const EntityInstanceT & instance)
inline

Add a single instance with data.

Parameters
instanceThe instance.
Returns
The stored instance.
Exceptions
`armem::error::InvalidArgument`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 call graph for this function:
+ Here is the caller graph for this function:

◆ addInstance() [3/3]

template<class _EntityInstanceT, class _Derived>
EntityInstanceT & addInstance ( EntityInstanceT && instance)
inline

Definition at line 270 of file EntitySnapshotBase.h.

+ Here is the call graph for this function:

◆ equalsDeep()

template<class _EntityInstanceT, class _Derived>
bool equalsDeep ( const DerivedT & other) const
inline

Definition at line 302 of file EntitySnapshotBase.h.

+ Here is the call graph for this function:

◆ findInstance() [1/4]

template<class _EntityInstanceT, class _Derived>
EntityInstanceT * findInstance ( const MemoryID & instanceID)
inline

Definition at line 136 of file EntitySnapshotBase.h.

+ Here is the call graph for this function:

◆ findInstance() [2/4]

template<class _EntityInstanceT, class _Derived>
const EntityInstanceT * findInstance ( const MemoryID & instanceID) const
inline

Definition at line 143 of file EntitySnapshotBase.h.

+ Here is the call graph for this function:

◆ findInstance() [3/4]

template<class _EntityInstanceT, class _Derived>
EntityInstanceT * findInstance ( int index)
inline

Definition at line 93 of file EntitySnapshotBase.h.

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

◆ findInstance() [4/4]

template<class _EntityInstanceT, class _Derived>
const EntityInstanceT * findInstance ( int index) const
inline

Definition at line 100 of file EntitySnapshotBase.h.

◆ forEachInstance() [1/2]

template<class _EntityInstanceT, class _Derived>
template<class InstanceFunctionT>
bool forEachInstance ( InstanceFunctionT && func)
inline
Parameters
funcFunction like void process(EntityInstanceT& instance)>

Definition at line 178 of file EntitySnapshotBase.h.

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

◆ forEachInstance() [2/2]

template<class _EntityInstanceT, class _Derived>
template<class InstanceFunctionT>
bool forEachInstance ( InstanceFunctionT && func) const
inline
Parameters
funcFunction like void process (const EntityInstanceT& instance)

Definition at line 188 of file EntitySnapshotBase.h.

+ Here is the call graph for this function:

◆ forEachInstanceIn() [1/2]

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

Definition at line 198 of file EntitySnapshotBase.h.

+ Here is the call graph for this function:

◆ forEachInstanceIn() [2/2]

template<class _EntityInstanceT, class _Derived>
template<class InstanceFunctionT>
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.

+ Here is the call graph for this function:

◆ getInstance() [1/4]

template<class _EntityInstanceT, class _Derived>
EntityInstanceT & getInstance ( const MemoryID & instanceID)
inline

Get the given instance.

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

Definition at line 158 of file EntitySnapshotBase.h.

+ Here is the call graph for this function:

◆ getInstance() [2/4]

template<class _EntityInstanceT, class _Derived>
const EntityInstanceT & getInstance ( const MemoryID & instanceID) const
inline

Definition at line 165 of file EntitySnapshotBase.h.

+ Here is the call graph for this function:

◆ getInstance() [3/4]

template<class _EntityInstanceT, class _Derived>
EntityInstanceT & getInstance ( int index)
inline

Get the given instance.

Parameters
indexThe instance's index.
Returns
The instance.
Exceptions
`armem::error::MissingEntry`If the given index is invalid.

Definition at line 114 of file EntitySnapshotBase.h.

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

◆ getInstance() [4/4]

template<class _EntityInstanceT, class _Derived>
const EntityInstanceT & getInstance ( int index) const
inline

Definition at line 121 of file EntitySnapshotBase.h.

+ Here is the call graph for this function:

◆ getInstanceIndices()

template<class _EntityInstanceT, class _Derived>
std::vector< int > getInstanceIndices ( ) const
inline

Definition at line 231 of file EntitySnapshotBase.h.

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

◆ getKeyString()

template<class _EntityInstanceT, class _Derived>
std::string getKeyString ( ) const
inline

Definition at line 322 of file EntitySnapshotBase.h.

+ Here is the call graph for this function:

◆ getLevelName()

template<class _EntityInstanceT, class _Derived>
static std::string getLevelName ( )
inlinestatic

Definition at line 328 of file EntitySnapshotBase.h.

◆ hasInstance() [1/2]

template<class _EntityInstanceT, class _Derived>
bool hasInstance ( const MemoryID & instanceID) const
inline

Definition at line 86 of file EntitySnapshotBase.h.

+ Here is the call graph for this function:

◆ hasInstance() [2/2]

template<class _EntityInstanceT, class _Derived>
bool hasInstance ( int index) const
inline

Definition at line 79 of file EntitySnapshotBase.h.

+ Here is the call graph for this function:

◆ hasInstances()

template<class _EntityInstanceT, class _Derived>
bool hasInstances ( ) const
inline

Indicate whether this snapshot has any instances.

Definition at line 72 of file EntitySnapshotBase.h.

+ Here is the call graph for this function:

◆ operator=() [1/2]

template<class _EntityInstanceT, class _Derived>
EntitySnapshotBase & operator= ( const EntitySnapshotBase< _EntityInstanceT, _Derived > & other)
default
+ Here is the call graph for this function:

◆ operator=() [2/2]

template<class _EntityInstanceT, class _Derived>
EntitySnapshotBase & operator= ( EntitySnapshotBase< _EntityInstanceT, _Derived > && other)
default
+ Here is the call graph for this function:

◆ time() [1/2]

template<class _EntityInstanceT, class _Derived>
Time & time ( )
inline

Definition at line 59 of file EntitySnapshotBase.h.

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

◆ time() [2/2]

template<class _EntityInstanceT, class _Derived>
const Time & time ( ) const
inline

Definition at line 65 of file EntitySnapshotBase.h.

+ Here is the call graph for this function:

◆ update()

template<class _EntityInstanceT, class _Derived>
void update ( const EntityUpdate & update)
inline

Definition at line 245 of file EntitySnapshotBase.h.

+ 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 file: