CoreSegment Class Reference

base::CoreSegmentBase More...

#include <RobotAPI/libraries/armem/server/wm/memory_definitions.h>

+ Inheritance diagram for CoreSegment:

Public Member Functions

template<class ... Args>
ProviderSegmentaddProviderSegment (const std::string &name, Args... args)
 
template<class FunctionT >
auto doLocked (FunctionT &&function) const
 
- Public Member Functions inherited from CoreSegmentBase< ProviderSegment, CoreSegment >
ProviderSegmentTaddProviderSegment (const ProviderSegmentT &providerSegment)
 Copy and insert a provider segment. More...
 
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...
 
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
 
bool forEachInstanceIn (const MemoryID &id, InstanceFunctionT &&func)
 
bool forEachInstanceIn (const MemoryID &id, InstanceFunctionT &&func) const
 
bool forEachProviderSegment (ProviderSegmentFunctionT &&func)
 
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, ProviderSegment >, CoreSegment >
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< CoreSegment >
std::map< MemoryID, std::vector< PredictionEngine > > getAllPredictionEngines () const
 
- Public Member Functions inherited from Predictive< CoreSegment >
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< CoreSegment >
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< CoreSegment >
bool forEachSnapshot (SnapshotFunctionT &&func)
 
bool forEachSnapshot (SnapshotFunctionT &&func) const
 
- Public Member Functions inherited from ForEachEntityMixin< CoreSegment >
bool forEachEntity (FunctionT &&func)
 
bool forEachEntity (FunctionT &&func) const
 
- Public Member Functions inherited from GetFindInstanceMixin< CoreSegment >
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< CoreSegment >
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< CoreSegment >
auto & getLatestInstance (int instanceIndex=0)
 Retrieve the latest entity instance. More...
 
const auto & getLatestInstance (int instanceIndex=0) const
 
- Public Member Functions inherited from GetLatestSnapshotMixin< CoreSegment >
auto & getLatestSnapshot (int snapshotIndex=0)
 Retrieve the latest entity snapshot. More...
 
const auto & getLatestSnapshot (int snapshotIndex=0) const
 
- Public Member Functions inherited from GetFindEntityMixin< CoreSegment >
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
 
- Public Member Functions inherited from MaxHistorySizeParent< CoreSegment >
void setMaxHistorySize (long maxSize)
 Sets the maximum history size of entities in this container. More...
 
- Public Member Functions inherited from MaxHistorySize
long getMaxHistorySize () const
 
void setMaxHistorySize (long maxSize, const std::string &additionalInfo="")
 Set the maximum number of snapshots to be contained in an entity. More...
 
- Public Member Functions inherited from FindInstanceDataMixin< CoreSegment >
aron::data::DictPtr findLatestInstanceData (const MemoryID &entityID, int instanceIndex=0) const
 
std::optional< AronDtoT > findLatestInstanceDataAs (const MemoryID &entityID, int instanceIndex=0) const
 
- Public Member Functions inherited from PredictionContainer< CoreSegment >
std::vector< PredictionResultdispatchPredictions (const std::vector< PredictionRequest > &requests)
 
PredictionResult dispatchTargetedPrediction (const PredictionRequest &request, const MemoryID &target)
 Semantics: This container or one of its children (target) is responsible for performing the prediction. More...
 
 PredictionContainer (const std::map< PredictionEngine, Predictor > &predictors={})
 
- Public Member Functions inherited from Prediction< CoreSegment >
void addPredictor (const PredictionEngine &engine, Predictor &&predictor)
 
std::vector< PredictionResultdispatchPredictions (const std::vector< PredictionRequest > &requests)
 Resolves mapping of requests to predictors and dispatches them. More...
 
PredictionResult dispatchTargetedPrediction (const PredictionRequest &request, const MemoryID &target)
 Dispatches a single prediction request (assuming resolution was done by the caller). More...
 
 Prediction (const std::map< PredictionEngine, Predictor > &predictors={})
 
void setPredictors (const std::map< PredictionEngine, Predictor > &predictors)
 

Additional Inherited Members

- Public Types inherited from CoreSegmentBase< ProviderSegment, CoreSegment >
using ChildT = ProviderSegmentT
 
using EntityInstanceT = typename EntitySnapshotT::EntityInstanceT
 
using EntitySnapshotT = typename EntityT::EntitySnapshotT
 
using EntityT = typename ProviderSegmentT::EntityT
 
using ProviderSegmentT = ProviderSegment
 
- Public Types inherited from MemoryContainerBase< std::map< std::string, ProviderSegment >, CoreSegment >
using ContainerT = std::map< std::string, ProviderSegment >
 
using DerivedT = CoreSegment
 
- Static Public Member Functions inherited from CoreSegmentBase< ProviderSegment, CoreSegment >
static std::string getLevelName ()
 
- Protected Member Functions inherited from CoreSegmentBase< ProviderSegment, CoreSegment >
std::pair< bool, ProviderSegmentT * > _addProviderSegmentIfMissing (const std::string &providerSegmentName)
 
- Protected Member Functions inherited from MemoryContainerBase< std::map< std::string, ProviderSegment >, CoreSegment >
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 inherited from CoreSegmentBase< ProviderSegment, CoreSegment >
static auto * _findEntity (ParentT &&parent, const std::string &entityName)
 
- Protected Attributes inherited from MemoryContainerBase< std::map< std::string, ProviderSegment >, CoreSegment >
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...
 
- Protected Attributes inherited from MaxHistorySize
long _maxHistorySize = -1
 Maximum size of entity histories. More...
 

Detailed Description

base::CoreSegmentBase

Definition at line 86 of file memory_definitions.h.

Member Function Documentation

◆ addProviderSegment()

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

Definition at line 101 of file memory_definitions.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doLocked()

auto doLocked ( FunctionT &&  function) const
inline

Definition at line 120 of file memory_definitions.h.

+ Here is the caller graph for this function:

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