CoreSegmentBase< _ProviderSegmentT, _Derived > Class Template Reference

Data of a core segment containing multiple provider segments. More...

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

+ Inheritance diagram for CoreSegmentBase< _ProviderSegmentT, _Derived >:

Classes

struct  UpdateResult
 

Public Types

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

Public Member Functions

ProviderSegmentTaddProviderSegment (const ProviderSegmentT &providerSegment)
 Copy and insert a provider segment. More...
 
template<class... Args>
ProviderSegmentTaddProviderSegment (const std::string &name, Args... args)
 Insert a provider segment in-place. More...
 
ProviderSegmentTaddProviderSegment (const std::string &name, aron::type::ObjectPtr providerSegmentType=nullptr, const std::vector< PredictionEngine > &predictionEngines={})
 Add an empty provider segment with the given name, optional provider segment type and prediction engines. More...
 
ProviderSegmentTaddProviderSegment (ProviderSegmentT &&providerSegment)
 Move and insert a provider segment. More...
 
template<class OtherDerivedT >
void append (const OtherDerivedT &other)
 
 CoreSegmentBase ()
 
 CoreSegmentBase (const CoreSegmentBase &other)=default
 
 CoreSegmentBase (const MemoryID &id, aron::type::ObjectPtr aronType=nullptr, const std::vector< PredictionEngine > &predictionEngines={})
 
 CoreSegmentBase (const std::string &name, aron::type::ObjectPtr aronType=nullptr, const std::vector< PredictionEngine > &predictionEngines={})
 
 CoreSegmentBase (const std::string &name, const MemoryID &parentID, aron::type::ObjectPtr aronType=nullptr, const std::vector< PredictionEngine > &predictionEngines={})
 
 CoreSegmentBase (CoreSegmentBase &&other)=default
 
bool equalsDeep (const DerivedT &other) const
 
EntityTfindEntity (const std::string &entityName)
 
const EntityTfindEntity (const std::string &entityName) const
 
ProviderSegmentTfindProviderSegment (const MemoryID &providerSegmentID)
 
const ProviderSegmentTfindProviderSegment (const MemoryID &providerSegmentID) const
 
ProviderSegmentTfindProviderSegment (const std::string &name)
 
const ProviderSegmentTfindProviderSegment (const std::string &name) const
 
template<class InstanceFunctionT >
bool forEachInstanceIn (const MemoryID &id, InstanceFunctionT &&func)
 
template<class InstanceFunctionT >
bool forEachInstanceIn (const MemoryID &id, InstanceFunctionT &&func) const
 
template<class ProviderSegmentFunctionT >
bool forEachProviderSegment (ProviderSegmentFunctionT &&func)
 
template<class ProviderSegmentFunctionT >
bool forEachProviderSegment (ProviderSegmentFunctionT &&func) const
 
std::string getKeyString () const
 
ProviderSegmentTgetProviderSegment (const MemoryID &providerSegmentID)
 
const ProviderSegmentTgetProviderSegment (const MemoryID &providerSegmentID) const
 
ProviderSegmentTgetProviderSegment (const std::string &name)
 
const ProviderSegmentTgetProviderSegment (const std::string &name) const
 
std::vector< std::string > getProviderSegmentNames () const
 
bool hasEntity (const std::string &entityName) const
 
bool hasProviderSegment (const MemoryID &providerSegmentID) const
 
bool hasProviderSegment (const std::string &name) const
 
std::string & name ()
 
const std::string & name () const
 
CoreSegmentBaseoperator= (const CoreSegmentBase &other)=default
 
CoreSegmentBaseoperator= (CoreSegmentBase &&other)=default
 
UpdateResult update (const EntityUpdate &update)
 Updates an entity's history. More...
 
- Public Member Functions inherited from MemoryContainerBase< std::map< std::string, _ProviderSegmentT >, _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 PredictiveContainer< _Derived >
std::map< MemoryID, std::vector< PredictionEngine > > getAllPredictionEngines () 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 ForEachEntityMixin< _Derived >
bool forEachEntity (FunctionT &&func)
 
bool forEachEntity (FunctionT &&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
 
- Public Member Functions inherited from GetFindEntityMixin< _Derived >
auto * findEntity (const MemoryID &entityID)
 Find an entity. More...
 
const auto * findEntity (const MemoryID &entityID) const
 
auto & getEntity (const MemoryID &entityID)
 Retrieve an entity. More...
 
const auto & getEntity (const MemoryID &entityID) const
 
bool hasEntity (const MemoryID &entityID) const
 

Static Public Member Functions

static std::string getLevelName ()
 

Protected Member Functions

std::pair< bool, ProviderSegmentT * > _addProviderSegmentIfMissing (const std::string &providerSegmentName)
 
- Protected Member Functions inherited from MemoryContainerBase< std::map< std::string, _ProviderSegmentT >, _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 ()
 

Static Protected Member Functions

template<class ParentT >
static auto * _findEntity (ParentT &&parent, const std::string &entityName)
 

Additional Inherited Members

- Protected Attributes inherited from MemoryContainerBase< std::map< std::string, _ProviderSegmentT >, _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 _ProviderSegmentT, class _Derived>
class armarx::armem::base::CoreSegmentBase< _ProviderSegmentT, _Derived >

Data of a core segment containing multiple provider segments.

Definition at line 22 of file CoreSegmentBase.h.

Member Typedef Documentation

◆ ChildT

Definition at line 45 of file CoreSegmentBase.h.

◆ EntityInstanceT

using EntityInstanceT = typename EntitySnapshotT::EntityInstanceT

Definition at line 43 of file CoreSegmentBase.h.

◆ EntitySnapshotT

using EntitySnapshotT = typename EntityT::EntitySnapshotT

Definition at line 42 of file CoreSegmentBase.h.

◆ EntityT

using EntityT = typename ProviderSegmentT::EntityT

Definition at line 41 of file CoreSegmentBase.h.

◆ ProviderSegmentT

using ProviderSegmentT = _ProviderSegmentT

Definition at line 40 of file CoreSegmentBase.h.

Constructor & Destructor Documentation

◆ CoreSegmentBase() [1/6]

CoreSegmentBase ( )
inline

Definition at line 68 of file CoreSegmentBase.h.

◆ CoreSegmentBase() [2/6]

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

Definition at line 72 of file CoreSegmentBase.h.

◆ CoreSegmentBase() [3/6]

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

Definition at line 79 of file CoreSegmentBase.h.

◆ CoreSegmentBase() [4/6]

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

Definition at line 87 of file CoreSegmentBase.h.

◆ CoreSegmentBase() [5/6]

CoreSegmentBase ( const CoreSegmentBase< _ProviderSegmentT, _Derived > &  other)
default

◆ CoreSegmentBase() [6/6]

CoreSegmentBase ( CoreSegmentBase< _ProviderSegmentT, _Derived > &&  other)
default

Member Function Documentation

◆ _addProviderSegmentIfMissing()

std::pair<bool, ProviderSegmentT*> _addProviderSegmentIfMissing ( const std::string &  providerSegmentName)
inlineprotected

Definition at line 432 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ _findEntity()

static auto* _findEntity ( ParentT &&  parent,
const std::string &  entityName 
)
inlinestaticprotected

Definition at line 419 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ addProviderSegment() [1/4]

ProviderSegmentT& addProviderSegment ( const ProviderSegmentT providerSegment)
inline

Copy and insert a provider segment.

Definition at line 355 of file CoreSegmentBase.h.

◆ addProviderSegment() [2/4]

ProviderSegmentT& addProviderSegment ( const std::string &  name,
Args...  args 
)
inline

Insert a provider segment in-place.

Definition at line 372 of file CoreSegmentBase.h.

◆ addProviderSegment() [3/4]

ProviderSegmentT& addProviderSegment ( const std::string &  name,
aron::type::ObjectPtr  providerSegmentType = nullptr,
const std::vector< PredictionEngine > &  predictionEngines = {} 
)
inline

Add an empty provider segment with the given name, optional provider segment type and prediction engines.

Parameters
nameThe segment name.
providerSegmentTypeThe provider type. If nullptr, the core segment type is used.
predictionEnginesThe prediction engines supported by the provider segment (optional).
Returns
The added provider segment.

Definition at line 344 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ addProviderSegment() [4/4]

ProviderSegmentT& addProviderSegment ( ProviderSegmentT &&  providerSegment)
inline

Move and insert a provider segment.

Definition at line 363 of file CoreSegmentBase.h.

◆ append()

void append ( const OtherDerivedT &  other)
inline

Definition at line 307 of file CoreSegmentBase.h.

◆ equalsDeep()

bool equalsDeep ( const DerivedT other) const
inline

Definition at line 382 of file CoreSegmentBase.h.

◆ findEntity() [1/2]

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

Definition at line 199 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ findEntity() [2/2]

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

Definition at line 205 of file CoreSegmentBase.h.

◆ findProviderSegment() [1/4]

ProviderSegmentT* findProviderSegment ( const MemoryID providerSegmentID)
inline

Definition at line 156 of file CoreSegmentBase.h.

◆ findProviderSegment() [2/4]

const ProviderSegmentT* findProviderSegment ( const MemoryID providerSegmentID) const
inline

Definition at line 163 of file CoreSegmentBase.h.

◆ findProviderSegment() [3/4]

ProviderSegmentT* findProviderSegment ( const std::string &  name)
inline

Definition at line 130 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ findProviderSegment() [4/4]

const ProviderSegmentT* findProviderSegment ( const std::string &  name) const
inline

Definition at line 136 of file CoreSegmentBase.h.

◆ forEachInstanceIn() [1/2]

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

Definition at line 242 of file CoreSegmentBase.h.

◆ forEachInstanceIn() [2/2]

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

Definition at line 258 of file CoreSegmentBase.h.

◆ forEachProviderSegment() [1/2]

bool forEachProviderSegment ( ProviderSegmentFunctionT &&  func)
inline
Parameters
funcFunction like: bool process(ProviderSegmentT& provSeg)

Definition at line 217 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ forEachProviderSegment() [2/2]

bool forEachProviderSegment ( ProviderSegmentFunctionT &&  func) const
inline
Parameters
funcFunction like: bool process(const ProviderSegmentT& provSeg)

Definition at line 227 of file CoreSegmentBase.h.

◆ getKeyString()

std::string getKeyString ( ) const
inline

Definition at line 410 of file CoreSegmentBase.h.

◆ getLevelName()

static std::string getLevelName ( )
inlinestatic

Definition at line 404 of file CoreSegmentBase.h.

◆ getProviderSegment() [1/4]

ProviderSegmentT& getProviderSegment ( const MemoryID providerSegmentID)
inline

Definition at line 171 of file CoreSegmentBase.h.

◆ getProviderSegment() [2/4]

const ProviderSegmentT& getProviderSegment ( const MemoryID providerSegmentID) const
inline

Definition at line 178 of file CoreSegmentBase.h.

◆ getProviderSegment() [3/4]

ProviderSegmentT& getProviderSegment ( const std::string &  name)
inline

Definition at line 143 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ getProviderSegment() [4/4]

const ProviderSegmentT& getProviderSegment ( const std::string &  name) const
inline

Definition at line 149 of file CoreSegmentBase.h.

◆ getProviderSegmentNames()

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

Definition at line 271 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ hasEntity()

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

Definition at line 193 of file CoreSegmentBase.h.

◆ hasProviderSegment() [1/2]

bool hasProviderSegment ( const MemoryID providerSegmentID) const
inline

Definition at line 123 of file CoreSegmentBase.h.

◆ hasProviderSegment() [2/2]

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

Definition at line 116 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ name() [1/2]

std::string& name ( )
inline

Definition at line 103 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ name() [2/2]

const std::string& name ( ) const
inline

Definition at line 109 of file CoreSegmentBase.h.

◆ operator=() [1/2]

CoreSegmentBase& operator= ( const CoreSegmentBase< _ProviderSegmentT, _Derived > &  other)
default

◆ operator=() [2/2]

CoreSegmentBase& operator= ( CoreSegmentBase< _ProviderSegmentT, _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 284 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

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