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 = std::map< std::string, _EntityT >
 
using DerivedT = _Derived
 

Public Member Functions

EntityTaddEntity (const EntityT &entity)
 Copy and insert an entity. More...
 
EntityTaddEntity (const std::string &name)
 Add an empty entity with the given name. More...
 
template<class... Args>
EntityTaddEntity (const std::string &name, Args... args)
 Insert an entity in-place. More...
 
EntityTaddEntity (EntityT &&entity)
 Move and insert an entity. More...
 
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. More...
 
- Public Member Functions inherited from MemoryContainerBase< std::map< std::string, _EntityT >, _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
 
- Public Member Functions inherited from AronTyped
aron::type::ObjectPtraronType ()
 
aron::type::ObjectPtr aronType () const
 
 AronTyped (aron::type::ObjectPtr aronType=nullptr)
 
bool hasAronType () const
 
- 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. More...
 
bool forEachInstanceWithDataAs (EntityInstanceBaseAronDtoFunctionT &&func) const
 Call func on each instance with its data converted to Aron DTO class. More...
 
- 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. More...
 
const auto * findInstance (const MemoryID &instanceID) const
 
auto & getInstance (const MemoryID &instanceID)
 Retrieve an entity instance. More...
 
const auto & getInstance (const MemoryID &instanceID) const
 
bool hasInstance (const MemoryID &instanceID) const
 Indicate whether this container has an instance with the given ID. More...
 
bool hasInstances () const
 Indicate whether this container contains at least one entity instance. More...
 
- Public Member Functions inherited from GetFindSnapshotMixin< _Derived >
auto * findLatestInstance (const MemoryID &entityID, int instanceIndex=0)
 Find the latest entity instance in the given entity. More...
 
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. More...
 
auto * findLatestSnapshot ()
 
const auto * findLatestSnapshot () const
 Find the latest entity snapshot. More...
 
auto * findLatestSnapshot (const MemoryID &entityID)
 Find the latest entity snapshot in the given entity. More...
 
const auto * findLatestSnapshot (const MemoryID &entityID) const
 
auto * findSnapshot (const MemoryID &snapshotID)
 Find an entity snapshot. More...
 
const auto * findSnapshot (const MemoryID &snapshotID) const
 
auto & getSnapshot (const MemoryID &snapshotID)
 Retrieve an entity snapshot. More...
 
const auto & getSnapshot (const MemoryID &snapshotID) const
 
bool hasSnapshot (const MemoryID &snapshotID) const
 Indicates whether a snapshot with the given ID exists. More...
 
bool hasSnapshots () const
 Indicate whether this container contains at least one entity snapshot. More...
 
- Public Member Functions inherited from GetLatestInstanceMixin< _Derived >
auto & getLatestInstance (int instanceIndex=0)
 Retrieve the latest entity instance. More...
 
const auto & getLatestInstance (int instanceIndex=0) const
 
- Public Member Functions inherited from GetLatestSnapshotMixin< _Derived >
auto & getLatestSnapshot (int snapshotIndex=0)
 Retrieve the latest entity snapshot. More...
 
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)
 
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::map< std::string, _EntityT >, _Derived >
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. More...
 

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

using ChildT = EntityT

Definition at line 41 of file ProviderSegmentBase.h.

◆ EntityInstanceT

using EntityInstanceT = typename EntitySnapshotT::EntityInstanceT

Definition at line 39 of file ProviderSegmentBase.h.

◆ EntitySnapshotT

using EntitySnapshotT = typename EntityT::EntitySnapshotT

Definition at line 38 of file ProviderSegmentBase.h.

◆ EntityT

using EntityT = _EntityT

Definition at line 37 of file ProviderSegmentBase.h.

Constructor & Destructor Documentation

◆ ProviderSegmentBase() [1/6]

ProviderSegmentBase ( )
inline

Definition at line 60 of file ProviderSegmentBase.h.

◆ ProviderSegmentBase() [2/6]

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

Definition at line 64 of file ProviderSegmentBase.h.

◆ ProviderSegmentBase() [3/6]

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

Definition at line 71 of file ProviderSegmentBase.h.

◆ ProviderSegmentBase() [4/6]

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

Definition at line 79 of file ProviderSegmentBase.h.

◆ ProviderSegmentBase() [5/6]

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

◆ ProviderSegmentBase() [6/6]

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

Member Function Documentation

◆ addEntity() [1/4]

EntityT& addEntity ( const EntityT entity)
inline

Copy and insert an entity.

Definition at line 305 of file ProviderSegmentBase.h.

◆ addEntity() [2/4]

EntityT& addEntity ( const std::string &  name)
inline

Add an empty entity with the given name.

Definition at line 298 of file ProviderSegmentBase.h.

+ Here is the caller graph for this function:

◆ addEntity() [3/4]

EntityT& addEntity ( const std::string &  name,
Args...  args 
)
inline

Insert an entity in-place.

Definition at line 321 of file ProviderSegmentBase.h.

◆ addEntity() [4/4]

EntityT& addEntity ( EntityT &&  entity)
inline

Move and insert an entity.

Definition at line 312 of file ProviderSegmentBase.h.

◆ append()

void append ( const OtherDerivedT &  other)
inline

Definition at line 279 of file ProviderSegmentBase.h.

◆ equalsDeep()

bool equalsDeep ( const DerivedT other) const
inline

Definition at line 331 of file ProviderSegmentBase.h.

◆ findEntity() [1/4]

EntityT* findEntity ( const MemoryID entityID)
inline

Definition at line 148 of file ProviderSegmentBase.h.

◆ findEntity() [2/4]

const EntityT* findEntity ( const MemoryID entityID) const
inline

Definition at line 155 of file ProviderSegmentBase.h.

◆ findEntity() [3/4]

EntityT* findEntity ( const std::string &  name)
inline

Definition at line 122 of file ProviderSegmentBase.h.

+ Here is the caller graph for this function:

◆ findEntity() [4/4]

const EntityT* findEntity ( const std::string &  name) const
inline

Definition at line 128 of file ProviderSegmentBase.h.

◆ forEachEntity() [1/2]

bool forEachEntity ( EntityFunctionT &&  func)
inline
Parameters
funcFunction like: bool process(EntityT& entity)

Definition at line 189 of file ProviderSegmentBase.h.

+ Here is the caller graph for this function:

◆ forEachEntity() [2/2]

bool forEachEntity ( EntityFunctionT &&  func) const
inline
Parameters
funcFunction like: bool process(const EntityT& entity)

Definition at line 199 of file ProviderSegmentBase.h.

◆ forEachInstanceIn() [1/2]

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

Definition at line 212 of file ProviderSegmentBase.h.

◆ forEachInstanceIn() [2/2]

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

Definition at line 227 of file ProviderSegmentBase.h.

◆ getEntity() [1/4]

EntityT& getEntity ( const MemoryID entityID)
inline

Definition at line 163 of file ProviderSegmentBase.h.

◆ getEntity() [2/4]

const EntityT& getEntity ( const MemoryID entityID) const
inline

Definition at line 170 of file ProviderSegmentBase.h.

◆ getEntity() [3/4]

EntityT& getEntity ( const std::string &  name)
inline

Definition at line 135 of file ProviderSegmentBase.h.

+ Here is the caller graph for this function:

◆ getEntity() [4/4]

const EntityT& getEntity ( const std::string &  name) const
inline

Definition at line 141 of file ProviderSegmentBase.h.

◆ getEntityNames()

std::vector<std::string> getEntityNames ( ) const
inline

Definition at line 239 of file ProviderSegmentBase.h.

◆ getKeyString()

std::string getKeyString ( ) const
inline

Definition at line 359 of file ProviderSegmentBase.h.

◆ getLevelName()

static std::string getLevelName ( )
inlinestatic

Definition at line 353 of file ProviderSegmentBase.h.

◆ hasEntity() [1/2]

bool hasEntity ( const MemoryID entityID) const
inline

Definition at line 115 of file ProviderSegmentBase.h.

◆ hasEntity() [2/2]

bool hasEntity ( const std::string &  name) const
inline

Definition at line 108 of file ProviderSegmentBase.h.

+ Here is the caller graph for this function:

◆ name() [1/2]

std::string& name ( )
inline

Definition at line 95 of file ProviderSegmentBase.h.

+ Here is the caller graph for this function:

◆ name() [2/2]

const std::string& name ( ) const
inline

Definition at line 101 of file ProviderSegmentBase.h.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ update()

UpdateResult update ( const EntityUpdate update)
inline

Updates an entity's history.

Missing entity entries are added before updating.

Definition at line 252 of file ProviderSegmentBase.h.

+ Here is the caller graph for this function:

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