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

Public Member Functions

ProviderSegmentTaddProviderSegment (const ProviderSegmentT &providerSegment)
 Copy and insert a provider segment.
 
template<class... Args>
ProviderSegmentTaddProviderSegment (const std::string &name, Args... args)
 Insert a provider segment in-place.
 
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.
 
ProviderSegmentTaddProviderSegment (ProviderSegmentT &&providerSegment)
 Move and insert a provider segment.
 
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.
 
- Public Member Functions inherited from MemoryContainerBase< std::map< std::string, _ProviderSegmentT >, _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 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.
 
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 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.
 
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
 
- Public Member Functions inherited from GetFindEntityMixin< _Derived >
auto * findEntity (const MemoryID &entityID)
 Find an entity.
 
const auto * findEntity (const MemoryID &entityID) const
 
auto & getEntity (const MemoryID &entityID)
 Retrieve an entity.
 
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)
 
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 ()
 

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
 
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 _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

template<class _ProviderSegmentT, class _Derived>
using ChildT = ProviderSegmentT

Definition at line 45 of file CoreSegmentBase.h.

◆ ContainerT

template<class _ProviderSegmentT, class _Derived>
using ContainerT

Definition at line 21 of file MemoryContainerBase.h.

◆ DerivedT

template<class _ProviderSegmentT, class _Derived>
using DerivedT

Definition at line 20 of file MemoryContainerBase.h.

◆ EntityInstanceT

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

Definition at line 43 of file CoreSegmentBase.h.

◆ EntitySnapshotT

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

Definition at line 42 of file CoreSegmentBase.h.

◆ EntityT

template<class _ProviderSegmentT, class _Derived>
using EntityT = typename ProviderSegmentT::EntityT

Definition at line 41 of file CoreSegmentBase.h.

◆ ProviderSegmentT

template<class _ProviderSegmentT, class _Derived>
using ProviderSegmentT = _ProviderSegmentT

Definition at line 40 of file CoreSegmentBase.h.

Constructor & Destructor Documentation

◆ CoreSegmentBase() [1/6]

template<class _ProviderSegmentT, class _Derived>
CoreSegmentBase ( )
inline

Definition at line 70 of file CoreSegmentBase.h.

◆ CoreSegmentBase() [2/6]

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

Definition at line 74 of file CoreSegmentBase.h.

◆ CoreSegmentBase() [3/6]

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

Definition at line 81 of file CoreSegmentBase.h.

◆ CoreSegmentBase() [4/6]

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

Definition at line 89 of file CoreSegmentBase.h.

◆ CoreSegmentBase() [5/6]

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

◆ CoreSegmentBase() [6/6]

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

Member Function Documentation

◆ _addProviderSegmentIfMissing()

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

Definition at line 434 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ _findEntity()

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

Definition at line 421 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ addProviderSegment() [1/4]

template<class _ProviderSegmentT, class _Derived>
ProviderSegmentT & addProviderSegment ( const ProviderSegmentT & providerSegment)
inline

Copy and insert a provider segment.

Definition at line 357 of file CoreSegmentBase.h.

◆ addProviderSegment() [2/4]

template<class _ProviderSegmentT, class _Derived>
template<class... Args>
ProviderSegmentT & addProviderSegment ( const std::string & name,
Args... args )
inline

Insert a provider segment in-place.

Definition at line 374 of file CoreSegmentBase.h.

◆ addProviderSegment() [3/4]

template<class _ProviderSegmentT, class _Derived>
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 346 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ addProviderSegment() [4/4]

template<class _ProviderSegmentT, class _Derived>
ProviderSegmentT & addProviderSegment ( ProviderSegmentT && providerSegment)
inline

Move and insert a provider segment.

Definition at line 365 of file CoreSegmentBase.h.

◆ append()

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

Definition at line 309 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ equalsDeep()

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

Definition at line 384 of file CoreSegmentBase.h.

◆ findEntity() [1/2]

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

Definition at line 201 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ findEntity() [2/2]

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

Definition at line 207 of file CoreSegmentBase.h.

◆ findProviderSegment() [1/4]

template<class _ProviderSegmentT, class _Derived>
ProviderSegmentT * findProviderSegment ( const MemoryID & providerSegmentID)
inline

Definition at line 158 of file CoreSegmentBase.h.

◆ findProviderSegment() [2/4]

template<class _ProviderSegmentT, class _Derived>
const ProviderSegmentT * findProviderSegment ( const MemoryID & providerSegmentID) const
inline

Definition at line 165 of file CoreSegmentBase.h.

◆ findProviderSegment() [3/4]

template<class _ProviderSegmentT, class _Derived>
ProviderSegmentT * findProviderSegment ( const std::string & name)
inline

Definition at line 132 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ findProviderSegment() [4/4]

template<class _ProviderSegmentT, class _Derived>
const ProviderSegmentT * findProviderSegment ( const std::string & name) const
inline

Definition at line 138 of file CoreSegmentBase.h.

◆ forEachInstanceIn() [1/2]

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

Definition at line 244 of file CoreSegmentBase.h.

◆ forEachInstanceIn() [2/2]

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

Definition at line 260 of file CoreSegmentBase.h.

◆ forEachProviderSegment() [1/2]

template<class _ProviderSegmentT, class _Derived>
template<class ProviderSegmentFunctionT>
bool forEachProviderSegment ( ProviderSegmentFunctionT && func)
inline
Parameters
funcFunction like: bool process(ProviderSegmentT& provSeg)

Definition at line 219 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ forEachProviderSegment() [2/2]

template<class _ProviderSegmentT, class _Derived>
template<class ProviderSegmentFunctionT>
bool forEachProviderSegment ( ProviderSegmentFunctionT && func) const
inline
Parameters
funcFunction like: bool process(const ProviderSegmentT& provSeg)

Definition at line 229 of file CoreSegmentBase.h.

◆ getKeyString()

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

Definition at line 412 of file CoreSegmentBase.h.

◆ getLevelName()

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

Definition at line 406 of file CoreSegmentBase.h.

◆ getProviderSegment() [1/4]

template<class _ProviderSegmentT, class _Derived>
ProviderSegmentT & getProviderSegment ( const MemoryID & providerSegmentID)
inline

Definition at line 173 of file CoreSegmentBase.h.

◆ getProviderSegment() [2/4]

template<class _ProviderSegmentT, class _Derived>
const ProviderSegmentT & getProviderSegment ( const MemoryID & providerSegmentID) const
inline

Definition at line 180 of file CoreSegmentBase.h.

◆ getProviderSegment() [3/4]

template<class _ProviderSegmentT, class _Derived>
ProviderSegmentT & getProviderSegment ( const std::string & name)
inline

Definition at line 145 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ getProviderSegment() [4/4]

template<class _ProviderSegmentT, class _Derived>
const ProviderSegmentT & getProviderSegment ( const std::string & name) const
inline

Definition at line 151 of file CoreSegmentBase.h.

◆ getProviderSegmentNames()

template<class _ProviderSegmentT, class _Derived>
std::vector< std::string > getProviderSegmentNames ( ) const
inline

Definition at line 273 of file CoreSegmentBase.h.

◆ hasEntity()

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

Definition at line 195 of file CoreSegmentBase.h.

◆ hasProviderSegment() [1/2]

template<class _ProviderSegmentT, class _Derived>
bool hasProviderSegment ( const MemoryID & providerSegmentID) const
inline

Definition at line 125 of file CoreSegmentBase.h.

◆ hasProviderSegment() [2/2]

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

Definition at line 118 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ name() [1/2]

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

Definition at line 105 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

◆ name() [2/2]

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

Definition at line 111 of file CoreSegmentBase.h.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ update()

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

Updates an entity's history.

Missing entity entries are added before updating.

Definition at line 286 of file CoreSegmentBase.h.

+ Here is the caller graph for this function:

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