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

ProviderSegmentT & addProviderSegment (const ProviderSegmentT &providerSegment)
 Copy and insert a provider segment.
 
template<class... Args>
ProviderSegmentT & addProviderSegment (const std::string &name, Args... args)
 Insert a provider segment in-place.
 
ProviderSegmentT & addProviderSegment (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.
 
ProviderSegmentT & addProviderSegment (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
 
EntityT * findEntity (const std::string &entityName)
 
const EntityT * findEntity (const std::string &entityName) const
 
ProviderSegmentT * findProviderSegment (const MemoryID &providerSegmentID)
 
const ProviderSegmentT * findProviderSegment (const MemoryID &providerSegmentID) const
 
ProviderSegmentT * findProviderSegment (const std::string &name)
 
const ProviderSegmentT * findProviderSegment (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
 
ProviderSegmentT & getProviderSegment (const MemoryID &providerSegmentID)
 
const ProviderSegmentT & getProviderSegment (const MemoryID &providerSegmentID) const
 
ProviderSegmentT & getProviderSegment (const std::string &name)
 
const ProviderSegmentT & getProviderSegment (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
 
CoreSegmentBase & operator= (const CoreSegmentBase &other)=default
 
CoreSegmentBase & operator= (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
 
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
 
- Public Member Functions inherited from AronTyped
aron::type::ObjectPtr & aronType ()
 
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
 
ContainerT & container ()
 
ContainerT & container ()
 
const ContainerT & container () const
 
const ContainerT & container () 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.

Member Typedef Documentation

◆ ChildT

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

◆ ContainerT

template<class _ProviderSegmentT, class _Derived>
using ContainerT

◆ DerivedT

template<class _ProviderSegmentT, class _Derived>
using DerivedT

◆ EntityInstanceT

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

◆ EntitySnapshotT

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

◆ EntityT

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

◆ ProviderSegmentT

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

Constructor & Destructor Documentation

◆ CoreSegmentBase() [1/6]

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

◆ CoreSegmentBase() [2/6]

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

◆ 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

◆ CoreSegmentBase() [4/6]

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

◆ 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

◆ _findEntity()

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

◆ addProviderSegment() [1/4]

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

Copy and insert a provider segment.

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

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

◆ addProviderSegment() [4/4]

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

Move and insert a provider segment.

◆ append()

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

◆ equalsDeep()

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

◆ findEntity() [1/2]

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

◆ findEntity() [2/2]

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

◆ findProviderSegment() [1/4]

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

◆ findProviderSegment() [2/4]

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

◆ findProviderSegment() [3/4]

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

◆ findProviderSegment() [4/4]

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

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

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

◆ forEachProviderSegment() [1/2]

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

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

◆ getKeyString()

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

◆ getLevelName()

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

◆ getProviderSegment() [1/4]

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

◆ getProviderSegment() [2/4]

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

◆ getProviderSegment() [3/4]

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

◆ getProviderSegment() [4/4]

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

◆ getProviderSegmentNames()

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

◆ hasEntity()

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

◆ hasProviderSegment() [1/2]

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

◆ hasProviderSegment() [2/2]

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

◆ name() [1/2]

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

◆ name() [2/2]

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

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


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