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

EntityInstanceT & addInstance ()
 
EntityInstanceT & addInstance (const EntityInstanceT &instance)
 Add a single instance with data.
 
EntityInstanceT & addInstance (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
 
EntityInstanceT * findInstance (const MemoryID &instanceID)
 
const EntityInstanceT * findInstance (const MemoryID &instanceID) const
 
EntityInstanceT * findInstance (int index)
 
const EntityInstanceT * findInstance (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
 
EntityInstanceT & getInstance (const MemoryID &instanceID)
 Get the given instance.
 
const EntityInstanceT & getInstance (const MemoryID &instanceID) const
 
EntityInstanceT & getInstance (int index)
 Get the given instance.
 
const EntityInstanceT & getInstance (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.
 
EntitySnapshotBase & operator= (const EntitySnapshotBase &other)=default
 
EntitySnapshotBase & operator= (EntitySnapshotBase &&other)=default
 
Time & time ()
 
const Time & time () 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
 
MemoryContainerBase & operator= (const MemoryContainerBase &other)=default
 
MemoryContainerBase & operator= (const MemoryContainerBase &other)=default
 
MemoryContainerBase & operator= (MemoryContainerBase &&other)=default
 
MemoryContainerBase & operator= (MemoryContainerBase &&other)=default
 
std::size_t size () const
 
std::size_t size () const
 
- Public Member Functions inherited from MemoryItem
MemoryID & id ()
 
const MemoryID & id () const
 
 MemoryItem ()
 
 MemoryItem (const MemoryID &id)
 
 MemoryItem (const MemoryItem &other)=default
 
 MemoryItem (MemoryItem &&other)=default
 
MemoryItem & operator= (const MemoryItem &other)=default
 
MemoryItem & operator= (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
 
ContainerT & container ()
 
ContainerT & container ()
 
const ContainerT & container () const
 
const ContainerT & container () 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.

Member Typedef Documentation

◆ EntityInstanceT

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

Constructor & Destructor Documentation

◆ EntitySnapshotBase() [1/5]

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

◆ EntitySnapshotBase() [2/5]

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

◆ EntitySnapshotBase() [3/5]

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

◆ EntitySnapshotBase() [4/5]

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

◆ EntitySnapshotBase() [5/5]

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

Member Function Documentation

◆ addInstance() [1/3]

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

◆ 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)

◆ addInstance() [3/3]

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

◆ equalsDeep()

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

◆ findInstance() [1/4]

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

◆ findInstance() [2/4]

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

◆ findInstance() [3/4]

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

◆ findInstance() [4/4]

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

◆ forEachInstance() [1/2]

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

◆ 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)

◆ 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)>

◆ 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)

◆ 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.

◆ getInstance() [2/4]

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

◆ 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.

◆ getInstance() [4/4]

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

◆ getInstanceIndices()

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

◆ getKeyString()

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

◆ getLevelName()

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

◆ hasInstance() [1/2]

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

◆ hasInstance() [2/2]

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

◆ hasInstances()

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

Indicate whether this snapshot has any instances.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ time() [1/2]

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

◆ time() [2/2]

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

◆ update()

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

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