ProviderSegmentBase< _EntityT, _Derived > Class Template Reference

Data of a provider segment containing multiple entities. More...

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

+ Inheritance diagram for ProviderSegmentBase< _EntityT, _Derived >:

Classes

struct  UpdateResult
 

Public Types

using ChildT = EntityT
 
using EntityInstanceT = typename EntitySnapshotT::EntityInstanceT
 
using EntitySnapshotT = typename EntityT::EntitySnapshotT
 
using EntityT = _EntityT
 
- Public Types inherited from MemoryContainerBase< std::map< std::string, _EntityT >, _Derived >
using ContainerT
 
using DerivedT
 

Public Member Functions

EntityTaddEntity (const EntityT &entity)
 Copy and insert an entity.
 
EntityTaddEntity (const std::string &name)
 Add an empty entity with the given name.
 
template<class... Args>
EntityTaddEntity (const std::string &name, Args... args)
 Insert an entity in-place.
 
EntityTaddEntity (EntityT &&entity)
 Move and insert an entity.
 
template<class OtherDerivedT>
void append (const OtherDerivedT &other)
 
bool equalsDeep (const DerivedT &other) const
 
EntityTfindEntity (const MemoryID &entityID)
 
const EntityTfindEntity (const MemoryID &entityID) const
 
EntityTfindEntity (const std::string &name)
 
const EntityTfindEntity (const std::string &name) const
 
template<class EntityFunctionT>
bool forEachEntity (EntityFunctionT &&func)
 
template<class EntityFunctionT>
bool forEachEntity (EntityFunctionT &&func) const
 
template<class InstanceFunctionT>
bool forEachInstanceIn (const MemoryID &id, InstanceFunctionT &&func)
 
template<class InstanceFunctionT>
bool forEachInstanceIn (const MemoryID &id, InstanceFunctionT &&func) const
 
EntityTgetEntity (const MemoryID &entityID)
 
const EntityTgetEntity (const MemoryID &entityID) const
 
EntityTgetEntity (const std::string &name)
 
const EntityTgetEntity (const std::string &name) const
 
std::vector< std::string > getEntityNames () const
 
std::string getKeyString () const
 
bool hasEntity (const MemoryID &entityID) const
 
bool hasEntity (const std::string &name) const
 
std::string & name ()
 
const std::string & name () const
 
ProviderSegmentBaseoperator= (const ProviderSegmentBase &other)=default
 
ProviderSegmentBaseoperator= (ProviderSegmentBase &&other)=default
 
 ProviderSegmentBase ()
 
 ProviderSegmentBase (const MemoryID id, aron::type::ObjectPtr aronType=nullptr, const std::vector< PredictionEngine > &predictionEngines={})
 
 ProviderSegmentBase (const ProviderSegmentBase &other)=default
 
 ProviderSegmentBase (const std::string &name, aron::type::ObjectPtr aronType=nullptr, const std::vector< PredictionEngine > &predictionEngines={})
 
 ProviderSegmentBase (const std::string &name, const MemoryID parentID, aron::type::ObjectPtr aronType=nullptr, const std::vector< PredictionEngine > &predictionEngines={})
 
 ProviderSegmentBase (ProviderSegmentBase &&other)=default
 
UpdateResult update (const EntityUpdate &update)
 Updates an entity's history.
 
- Public Member Functions inherited from MemoryContainerBase< std::map< std::string, _EntityT >, _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
 
- Public Member Functions inherited from AronTyped
aron::type::ObjectPtraronType ()
 
aron::type::ObjectPtr aronType () const
 
 AronTyped (aron::type::ObjectPtr aronType=nullptr)
 
bool hasAronType () const
 
void setAronType (aron::type::ObjectPtr aronType)
 
- Public Member Functions inherited from Predictive< _Derived >
void addPredictionEngine (const PredictionEngine &engine)
 
std::map< MemoryID, std::vector< PredictionEngine > > getAllPredictionEngines () const
 
const std::vector< PredictionEngine > & predictionEngines () const
 
 Predictive (const std::vector< PredictionEngine > &engines={})
 
void setPredictionEngines (const std::vector< PredictionEngine > &engines)
 
- Public Member Functions inherited from ForEachEntityInstanceMixin< _Derived >
bool forEachInstance (InstanceFunctionT &&func)
 
bool forEachInstance (InstanceFunctionT &&func) const
 
bool forEachInstanceAs (AronDtoFunctionT &&func) const
 Call func on the data of each instance converted to Aron DTO class.
 
bool forEachInstanceWithDataAs (EntityInstanceBaseAronDtoFunctionT &&func) const
 Call func on each instance with its data converted to Aron DTO class.
 
- Public Member Functions inherited from ForEachEntitySnapshotMixin< _Derived >
bool forEachSnapshot (SnapshotFunctionT &&func)
 
bool forEachSnapshot (SnapshotFunctionT &&func) const
 
- Public Member Functions inherited from GetFindInstanceMixin< _Derived >
auto * findInstance (const MemoryID &instanceID)
 Find an entity instance.
 
const auto * findInstance (const MemoryID &instanceID) const
 
auto & getInstance (const MemoryID &instanceID)
 Retrieve an entity instance.
 
const auto & getInstance (const MemoryID &instanceID) const
 
bool hasInstance (const MemoryID &instanceID) const
 Indicate whether this container has an instance with the given ID.
 
bool hasInstances () const
 Indicate whether this container contains at least one entity instance.
 
- Public Member Functions inherited from GetFindSnapshotMixin< _Derived >
auto * findLatestInstance (const MemoryID &entityID, int instanceIndex=0)
 Find the latest entity instance in the given entity.
 
const auto * findLatestInstance (const MemoryID &entityID, int instanceIndex=0) const
 
auto * findLatestInstance (int instanceIndex=0)
 
const auto * findLatestInstance (int instanceIndex=0) const
 Find the latest entity instance.
 
auto * findLatestSnapshot ()
 
const auto * findLatestSnapshot () const
 Find the latest entity snapshot.
 
auto * findLatestSnapshot (const MemoryID &entityID)
 Find the latest entity snapshot in the given entity.
 
const auto * findLatestSnapshot (const MemoryID &entityID) const
 
auto * findSnapshot (const MemoryID &snapshotID)
 Find an entity snapshot.
 
const auto * findSnapshot (const MemoryID &snapshotID) const
 
auto & getSnapshot (const MemoryID &snapshotID)
 Retrieve an entity snapshot.
 
const auto & getSnapshot (const MemoryID &snapshotID) const
 
bool hasSnapshot (const MemoryID &snapshotID) const
 Indicates whether a snapshot with the given ID exists.
 
bool hasSnapshots () const
 Indicate whether this container contains at least one entity snapshot.
 
- Public Member Functions inherited from GetLatestInstanceMixin< _Derived >
auto & getLatestInstance (int instanceIndex=0)
 Retrieve the latest entity instance.
 
const auto & getLatestInstance (int instanceIndex=0) const
 
- Public Member Functions inherited from GetLatestSnapshotMixin< _Derived >
auto & getLatestSnapshot (int snapshotIndex=0)
 Retrieve the latest entity snapshot.
 
const auto & getLatestSnapshot (int snapshotIndex=0) const
 

Static Public Member Functions

static std::string getLevelName ()
 

Additional Inherited Members

- Protected Member Functions inherited from MemoryContainerBase< std::map< std::string, _EntityT >, _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::map< std::string, _EntityT >, _Derived >
ContainerT _container
 
ContainerT _container
 
- Protected Attributes inherited from MemoryItem
MemoryID _id
 
- Protected Attributes inherited from AronTyped
aron::type::ObjectPtr _aronType
 The expected Aron type. May be nullptr, in which case no type information is available.
 

Detailed Description

template<class _EntityT, class _Derived>
class armarx::armem::base::ProviderSegmentBase< _EntityT, _Derived >

Data of a provider segment containing multiple entities.

Definition at line 22 of file ProviderSegmentBase.h.

Member Typedef Documentation

◆ ChildT

template<class _EntityT, class _Derived>
using ChildT = EntityT

Definition at line 41 of file ProviderSegmentBase.h.

◆ EntityInstanceT

template<class _EntityT, class _Derived>
using EntityInstanceT = typename EntitySnapshotT::EntityInstanceT

Definition at line 39 of file ProviderSegmentBase.h.

◆ EntitySnapshotT

template<class _EntityT, class _Derived>
using EntitySnapshotT = typename EntityT::EntitySnapshotT

Definition at line 38 of file ProviderSegmentBase.h.

◆ EntityT

template<class _EntityT, class _Derived>
using EntityT = _EntityT

Definition at line 37 of file ProviderSegmentBase.h.

Constructor & Destructor Documentation

◆ ProviderSegmentBase() [1/6]

template<class _EntityT, class _Derived>
ProviderSegmentBase ( )
inline

Definition at line 64 of file ProviderSegmentBase.h.

◆ ProviderSegmentBase() [2/6]

template<class _EntityT, class _Derived>
ProviderSegmentBase ( const std::string & name,
aron::type::ObjectPtr aronType = nullptr,
const std::vector< PredictionEngine > & predictionEngines = {} )
inlineexplicit

Definition at line 68 of file ProviderSegmentBase.h.

◆ ProviderSegmentBase() [3/6]

template<class _EntityT, class _Derived>
ProviderSegmentBase ( const std::string & name,
const MemoryID parentID,
aron::type::ObjectPtr aronType = nullptr,
const std::vector< PredictionEngine > & predictionEngines = {} )
inlineexplicit

Definition at line 75 of file ProviderSegmentBase.h.

◆ ProviderSegmentBase() [4/6]

template<class _EntityT, class _Derived>
ProviderSegmentBase ( const MemoryID id,
aron::type::ObjectPtr aronType = nullptr,
const std::vector< PredictionEngine > & predictionEngines = {} )
inlineexplicit

Definition at line 83 of file ProviderSegmentBase.h.

◆ ProviderSegmentBase() [5/6]

template<class _EntityT, class _Derived>
ProviderSegmentBase ( const ProviderSegmentBase< _EntityT, _Derived > & other)
default

◆ ProviderSegmentBase() [6/6]

template<class _EntityT, class _Derived>
ProviderSegmentBase ( ProviderSegmentBase< _EntityT, _Derived > && other)
default

Member Function Documentation

◆ addEntity() [1/4]

template<class _EntityT, class _Derived>
EntityT & addEntity ( const EntityT & entity)
inline

Copy and insert an entity.

Definition at line 309 of file ProviderSegmentBase.h.

◆ addEntity() [2/4]

template<class _EntityT, class _Derived>
EntityT & addEntity ( const std::string & name)
inline

Add an empty entity with the given name.

Definition at line 302 of file ProviderSegmentBase.h.

+ Here is the caller graph for this function:

◆ addEntity() [3/4]

template<class _EntityT, class _Derived>
template<class... Args>
EntityT & addEntity ( const std::string & name,
Args... args )
inline

Insert an entity in-place.

Definition at line 325 of file ProviderSegmentBase.h.

◆ addEntity() [4/4]

template<class _EntityT, class _Derived>
EntityT & addEntity ( EntityT && entity)
inline

Move and insert an entity.

Definition at line 316 of file ProviderSegmentBase.h.

◆ append()

template<class _EntityT, class _Derived>
template<class OtherDerivedT>
void append ( const OtherDerivedT & other)
inline

Definition at line 283 of file ProviderSegmentBase.h.

+ Here is the caller graph for this function:

◆ equalsDeep()

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

Definition at line 335 of file ProviderSegmentBase.h.

◆ findEntity() [1/4]

template<class _EntityT, class _Derived>
EntityT * findEntity ( const MemoryID & entityID)
inline

Definition at line 152 of file ProviderSegmentBase.h.

◆ findEntity() [2/4]

template<class _EntityT, class _Derived>
const EntityT * findEntity ( const MemoryID & entityID) const
inline

Definition at line 159 of file ProviderSegmentBase.h.

◆ findEntity() [3/4]

template<class _EntityT, class _Derived>
EntityT * findEntity ( const std::string & name)
inline

Definition at line 126 of file ProviderSegmentBase.h.

+ Here is the caller graph for this function:

◆ findEntity() [4/4]

template<class _EntityT, class _Derived>
const EntityT * findEntity ( const std::string & name) const
inline

Definition at line 132 of file ProviderSegmentBase.h.

◆ forEachEntity() [1/2]

template<class _EntityT, class _Derived>
template<class EntityFunctionT>
bool forEachEntity ( EntityFunctionT && func)
inline
Parameters
funcFunction like: bool process(EntityT& entity)

Definition at line 193 of file ProviderSegmentBase.h.

+ Here is the caller graph for this function:

◆ forEachEntity() [2/2]

template<class _EntityT, class _Derived>
template<class EntityFunctionT>
bool forEachEntity ( EntityFunctionT && func) const
inline
Parameters
funcFunction like: bool process(const EntityT& entity)

Definition at line 203 of file ProviderSegmentBase.h.

◆ forEachInstanceIn() [1/2]

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

Definition at line 216 of file ProviderSegmentBase.h.

◆ forEachInstanceIn() [2/2]

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

Definition at line 231 of file ProviderSegmentBase.h.

◆ getEntity() [1/4]

template<class _EntityT, class _Derived>
EntityT & getEntity ( const MemoryID & entityID)
inline

Definition at line 167 of file ProviderSegmentBase.h.

◆ getEntity() [2/4]

template<class _EntityT, class _Derived>
const EntityT & getEntity ( const MemoryID & entityID) const
inline

Definition at line 174 of file ProviderSegmentBase.h.

◆ getEntity() [3/4]

template<class _EntityT, class _Derived>
EntityT & getEntity ( const std::string & name)
inline

Definition at line 139 of file ProviderSegmentBase.h.

+ Here is the caller graph for this function:

◆ getEntity() [4/4]

template<class _EntityT, class _Derived>
const EntityT & getEntity ( const std::string & name) const
inline

Definition at line 145 of file ProviderSegmentBase.h.

◆ getEntityNames()

template<class _EntityT, class _Derived>
std::vector< std::string > getEntityNames ( ) const
inline

Definition at line 243 of file ProviderSegmentBase.h.

+ Here is the caller graph for this function:

◆ getKeyString()

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

Definition at line 363 of file ProviderSegmentBase.h.

◆ getLevelName()

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

Definition at line 357 of file ProviderSegmentBase.h.

◆ hasEntity() [1/2]

template<class _EntityT, class _Derived>
bool hasEntity ( const MemoryID & entityID) const
inline

Definition at line 119 of file ProviderSegmentBase.h.

◆ hasEntity() [2/2]

template<class _EntityT, class _Derived>
bool hasEntity ( const std::string & name) const
inline

Definition at line 112 of file ProviderSegmentBase.h.

+ Here is the caller graph for this function:

◆ name() [1/2]

template<class _EntityT, class _Derived>
std::string & name ( )
inline

Definition at line 99 of file ProviderSegmentBase.h.

+ Here is the caller graph for this function:

◆ name() [2/2]

template<class _EntityT, class _Derived>
const std::string & name ( ) const
inline

Definition at line 105 of file ProviderSegmentBase.h.

◆ operator=() [1/2]

template<class _EntityT, class _Derived>
ProviderSegmentBase & operator= ( const ProviderSegmentBase< _EntityT, _Derived > & other)
default

◆ operator=() [2/2]

template<class _EntityT, class _Derived>
ProviderSegmentBase & operator= ( ProviderSegmentBase< _EntityT, _Derived > && other)
default

◆ update()

template<class _EntityT, class _Derived>
UpdateResult update ( const EntityUpdate & update)
inline

Updates an entity's history.

Missing entity entries are added before updating.

Definition at line 256 of file ProviderSegmentBase.h.


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