MemoryBase< _CoreSegmentT > Class Template Referenceabstract

Interface functions for the longterm memory classes. More...

#include <RobotAPI/libraries/armem/server/ltm/detail/MemoryBase.h>

+ Inheritance diagram for MemoryBase< _CoreSegmentT >:

Classes

struct  Properties
 
struct  Statistics
 

Public Types

using CoreSegmentT = _CoreSegmentT
 

Public Member Functions

void configure ()
 initialize config
 
virtual void createPropertyDefinitions (PropertyDefinitionsPtr &defs, const std::string &prefix)
 default parameters. Implementation should use the configuration to configure
 
void disable ()
 disable this LTM
 
void enable ()
 enable this LTM
 
std::shared_ptr< CoreSegmentTfindCoreSegment (const std::string &coreSegmentName) const
 find core segment
 
bool forEachCoreSegment (std::function< void(CoreSegmentT &)> func) const
 iterate over all core segments of this ltm
 
DebugObserverInterfacePrx getDebugObserver () const
 Get the current debug observer (may be nullptr)
 
std::map< std::string, processor::SnapshotFilter::FilterStatisticsgetFilterStatistics ()
 
RecordingMode getRecordingMode () const
 
Statistics getStatistics () const
 
bool hasCoreSegment (const std::string &coreSegmentName) const
 check if core segment exists
 
bool isRecording () const
 
armem::wm::Memory loadAllAndResolve ()
 return the full ltm as a wm::Memory and resolves the references the ltm may be huge, use with caution
 
void loadAllAndResolve (armem::wm::Memory &memory)
 
void loadAllAndResolve (armem::wm::Memory &memory, std::list< std::string > coreSegmentNames)
 
armem::wm::Memory loadAllReferences ()
 return the full ltm as a wm::Memory with only references the ltm may be huge, use with caution
 
void loadAllReferences (armem::wm::Memory &memory)
 
armem::wm::Memory loadLatestNReferences (int n)
 
void loadLatestNReferences (int n, armem::wm::Memory &memory)
 
void loadLatestNReferences (int n, armem::wm::Memory &memory, std::list< std::string > coreSegNames)
 
void loadOnStartup ()
 
 MemoryBase (const std::string &exportName, const MemoryID &id)
 
virtual void resetStatistics ()
 statistics
 
void resolve (armem::wm::Memory &memory)
 convert the references of the input into a wm::Memory
 
void setDebugObserver (DebugObserverInterfacePrx observer)
 Set an optional debug observer for timing measurements.
 
void setRecordingMode (const RecordingMode m)
 
void setRecordingMode (const std::string &m)
 
void startRecording ()
 enable/disable
 
void stopRecording ()
 
void store (const armem::server::wm::Memory &serverMemory)
 append a wm::Memory instance to the ltm
 
void store (std::shared_ptr< const armem::wm::Memory > memory)
 append a wm::Memory instance to the ltm (asynchronously via thread pool)
 
void storeSnapshotsAsync (const std::string &memoryName, const std::vector< wm::EntitySnapshot > &snapshots, const std::vector< mixin::PendingConversion::SegmentMetadata > &segmentMetadata)
 Store snapshots with deferred conversion (happens in async thread) This is more efficient than calling store() with a pre-converted Memory because the expensive toMemory() conversion happens off the critical path.
 
- Public Member Functions inherited from MemoryItem
virtual std::string getExportName () const
 
MemoryID getMemoryID () const
 
MemoryID id () const
 
 MemoryItem (const std::string &exportName, const MemoryID &)
 
 MemoryItem (const std::string &exportName, const MemoryID &, const std::shared_ptr< Processors > &)
 
std::string name () const
 
void setExportName (const std::string &n)
 
void setMemoryID (const MemoryID &)
 
void setMemoryName (const std::string &memoryName)
 
virtual ~MemoryItem ()=default
 

Static Public Member Functions

static std::string getLevelName ()
 get level name1
 

Public Attributes

struct armarx::armem::server::ltm::detail::MemoryBase::Properties p
 

Protected Member Functions

virtual void _configure (const nlohmann::json &)
 configuration
 
virtual void _directlyStore (const armem::wm::Memory &memory, bool simulatedVersion=false)=0
 
virtual void _disable ()
 
virtual void _enable ()
 
virtual void _enqueueForAsyncStorage (std::shared_ptr< const armem::wm::Memory > memory)=0
 
virtual void _enqueuePendingConversion (mixin::PendingConversion pending)=0
 
virtual std::shared_ptr< CoreSegmentT_implFindCoreSegment (const std::string &coreSegmentName) const =0
 
virtual bool _implForEachCoreSegment (std::function< void(CoreSegmentT &)> func) const =0
 
virtual bool _implHasCoreSegment (const std::string &coreSegmentName) const =0
 
virtual void _loadAllReferences (armem::wm::Memory &memory)=0
 
virtual void _loadAllReferences (armem::wm::Memory &memory, std::list< std::string > coreSegNames)=0
 
virtual void _loadLatestNReferences (int n, armem::wm::Memory &memory)=0
 
virtual void _loadLatestNReferences (int n, armem::wm::Memory &memory, std::list< std::string > coreSegNames)=0
 
virtual void _loadOnStartup ()=0
 
virtual void _resolve (armem::wm::Memory &memory)=0
 
virtual void _setExportName (const std::string &)
 
virtual void _store (const armem::wm::Memory &memory)=0
 
- Protected Member Functions inherited from MemoryItem
virtual void _setMemoryID (const MemoryID &)
 

Protected Attributes

DebugObserverInterfacePrx debugObserver
 Optional debug observer for timing measurements.
 
std::atomic_bool enabled = true
 
RecordingMode recordingMode = RecordingMode::CONSOLIDATE_REMOVED
 
Statistics statistics
 
- Protected Attributes inherited from MemoryItem
std::shared_ptr< Processorsprocessors
 

Detailed Description

template<class _CoreSegmentT>
class armarx::armem::server::ltm::detail::MemoryBase< _CoreSegmentT >

Interface functions for the longterm memory classes.

Definition at line 49 of file MemoryBase.h.

Member Typedef Documentation

◆ CoreSegmentT

template<class _CoreSegmentT>
using CoreSegmentT = _CoreSegmentT

Definition at line 65 of file MemoryBase.h.

Constructor & Destructor Documentation

◆ MemoryBase()

template<class _CoreSegmentT>
MemoryBase ( const std::string & exportName,
const MemoryID & id )
inline

Definition at line 67 of file MemoryBase.h.

Member Function Documentation

◆ _configure()

template<class _CoreSegmentT>
virtual void _configure ( const nlohmann::json & )
inlineprotectedvirtual

configuration

Reimplemented in Memory.

Definition at line 531 of file MemoryBase.h.

+ Here is the caller graph for this function:

◆ _directlyStore()

template<class _CoreSegmentT>
virtual void _directlyStore ( const armem::wm::Memory & memory,
bool simulatedVersion = false )
protectedpure virtual

Implemented in Memory.

◆ _disable()

template<class _CoreSegmentT>
virtual void _disable ( )
inlineprotectedvirtual

Reimplemented in Memory.

Definition at line 541 of file MemoryBase.h.

+ Here is the caller graph for this function:

◆ _enable()

template<class _CoreSegmentT>
virtual void _enable ( )
inlineprotectedvirtual

Reimplemented in Memory.

Definition at line 536 of file MemoryBase.h.

+ Here is the caller graph for this function:

◆ _enqueueForAsyncStorage()

template<class _CoreSegmentT>
virtual void _enqueueForAsyncStorage ( std::shared_ptr< const armem::wm::Memory > memory)
protectedpure virtual

Implemented in Memory.

+ Here is the caller graph for this function:

◆ _enqueuePendingConversion()

template<class _CoreSegmentT>
virtual void _enqueuePendingConversion ( mixin::PendingConversion pending)
protectedpure virtual

Implemented in Memory.

+ Here is the caller graph for this function:

◆ _implFindCoreSegment()

template<class _CoreSegmentT>
virtual std::shared_ptr< CoreSegmentT > _implFindCoreSegment ( const std::string & coreSegmentName) const
protectedpure virtual

Implemented in Memory.

+ Here is the caller graph for this function:

◆ _implForEachCoreSegment()

template<class _CoreSegmentT>
virtual bool _implForEachCoreSegment ( std::function< void(CoreSegmentT &)> func) const
protectedpure virtual

Implemented in Memory.

+ Here is the caller graph for this function:

◆ _implHasCoreSegment()

template<class _CoreSegmentT>
virtual bool _implHasCoreSegment ( const std::string & coreSegmentName) const
protectedpure virtual

Implemented in Memory.

+ Here is the caller graph for this function:

◆ _loadAllReferences() [1/2]

template<class _CoreSegmentT>
virtual void _loadAllReferences ( armem::wm::Memory & memory)
protectedpure virtual

Implemented in Memory.

+ Here is the caller graph for this function:

◆ _loadAllReferences() [2/2]

template<class _CoreSegmentT>
virtual void _loadAllReferences ( armem::wm::Memory & memory,
std::list< std::string > coreSegNames )
protectedpure virtual

Implemented in Memory.

◆ _loadLatestNReferences() [1/2]

template<class _CoreSegmentT>
virtual void _loadLatestNReferences ( int n,
armem::wm::Memory & memory )
protectedpure virtual

Implemented in Memory.

+ Here is the caller graph for this function:

◆ _loadLatestNReferences() [2/2]

template<class _CoreSegmentT>
virtual void _loadLatestNReferences ( int n,
armem::wm::Memory & memory,
std::list< std::string > coreSegNames )
protectedpure virtual

Implemented in Memory.

◆ _loadOnStartup()

template<class _CoreSegmentT>
virtual void _loadOnStartup ( )
protectedpure virtual

Implemented in Memory.

+ Here is the caller graph for this function:

◆ _resolve()

template<class _CoreSegmentT>
virtual void _resolve ( armem::wm::Memory & memory)
protectedpure virtual

Implemented in Memory.

+ Here is the caller graph for this function:

◆ _setExportName()

template<class _CoreSegmentT>
virtual void _setExportName ( const std::string & )
inlineprotectedvirtual

Reimplemented from MemoryItem.

Reimplemented in Memory.

Definition at line 546 of file MemoryBase.h.

◆ _store()

template<class _CoreSegmentT>
virtual void _store ( const armem::wm::Memory & memory)
protectedpure virtual

Implemented in Memory.

◆ configure()

template<class _CoreSegmentT>
void configure ( )
inline

initialize config

Definition at line 107 of file MemoryBase.h.

◆ createPropertyDefinitions()

template<class _CoreSegmentT>
virtual void createPropertyDefinitions ( PropertyDefinitionsPtr & defs,
const std::string & prefix )
inlinevirtual

default parameters. Implementation should use the configuration to configure

Reimplemented in Memory.

Definition at line 394 of file MemoryBase.h.

◆ disable()

template<class _CoreSegmentT>
void disable ( )
inline

disable this LTM

Definition at line 159 of file MemoryBase.h.

+ Here is the caller graph for this function:

◆ enable()

template<class _CoreSegmentT>
void enable ( )
inline

enable this LTM

Definition at line 140 of file MemoryBase.h.

+ Here is the caller graph for this function:

◆ findCoreSegment()

template<class _CoreSegmentT>
std::shared_ptr< CoreSegmentT > findCoreSegment ( const std::string & coreSegmentName) const
inline

find core segment

Definition at line 387 of file MemoryBase.h.

◆ forEachCoreSegment()

template<class _CoreSegmentT>
bool forEachCoreSegment ( std::function< void(CoreSegmentT &)> func) const
inline

iterate over all core segments of this ltm

Definition at line 373 of file MemoryBase.h.

◆ getDebugObserver()

template<class _CoreSegmentT>
DebugObserverInterfacePrx getDebugObserver ( ) const
inline

Get the current debug observer (may be nullptr)

Definition at line 522 of file MemoryBase.h.

◆ getFilterStatistics()

template<class _CoreSegmentT>
std::map< std::string, processor::SnapshotFilter::FilterStatistics > getFilterStatistics ( )
inline

Definition at line 463 of file MemoryBase.h.

◆ getLevelName()

template<class _CoreSegmentT>
static std::string getLevelName ( )
inlinestatic

get level name1

Definition at line 485 of file MemoryBase.h.

◆ getRecordingMode()

template<class _CoreSegmentT>
RecordingMode getRecordingMode ( ) const
inline

Definition at line 100 of file MemoryBase.h.

◆ getStatistics()

template<class _CoreSegmentT>
Statistics getStatistics ( ) const
inline

Definition at line 457 of file MemoryBase.h.

◆ hasCoreSegment()

template<class _CoreSegmentT>
bool hasCoreSegment ( const std::string & coreSegmentName) const
inline

check if core segment exists

Definition at line 380 of file MemoryBase.h.

◆ isRecording()

template<class _CoreSegmentT>
bool isRecording ( ) const
inline

Definition at line 442 of file MemoryBase.h.

+ Here is the caller graph for this function:

◆ loadAllAndResolve() [1/3]

template<class _CoreSegmentT>
armem::wm::Memory loadAllAndResolve ( )
inline

return the full ltm as a wm::Memory and resolves the references the ltm may be huge, use with caution

Definition at line 223 of file MemoryBase.h.

+ Here is the caller graph for this function:

◆ loadAllAndResolve() [2/3]

template<class _CoreSegmentT>
void loadAllAndResolve ( armem::wm::Memory & memory)
inline

Definition at line 231 of file MemoryBase.h.

◆ loadAllAndResolve() [3/3]

template<class _CoreSegmentT>
void loadAllAndResolve ( armem::wm::Memory & memory,
std::list< std::string > coreSegmentNames )
inline

Definition at line 240 of file MemoryBase.h.

◆ loadAllReferences() [1/2]

template<class _CoreSegmentT>
armem::wm::Memory loadAllReferences ( )
inline

return the full ltm as a wm::Memory with only references the ltm may be huge, use with caution

Definition at line 177 of file MemoryBase.h.

+ Here is the caller graph for this function:

◆ loadAllReferences() [2/2]

template<class _CoreSegmentT>
void loadAllReferences ( armem::wm::Memory & memory)
inline

Definition at line 185 of file MemoryBase.h.

◆ loadLatestNReferences() [1/3]

template<class _CoreSegmentT>
armem::wm::Memory loadLatestNReferences ( int n)
inline

Definition at line 195 of file MemoryBase.h.

+ Here is the caller graph for this function:

◆ loadLatestNReferences() [2/3]

template<class _CoreSegmentT>
void loadLatestNReferences ( int n,
armem::wm::Memory & memory )
inline

Definition at line 213 of file MemoryBase.h.

◆ loadLatestNReferences() [3/3]

template<class _CoreSegmentT>
void loadLatestNReferences ( int n,
armem::wm::Memory & memory,
std::list< std::string > coreSegNames )
inline

Definition at line 205 of file MemoryBase.h.

◆ loadOnStartup()

template<class _CoreSegmentT>
void loadOnStartup ( )
inline

Definition at line 491 of file MemoryBase.h.

◆ resetStatistics()

template<class _CoreSegmentT>
virtual void resetStatistics ( )
inlinevirtual

statistics

Definition at line 449 of file MemoryBase.h.

◆ resolve()

template<class _CoreSegmentT>
void resolve ( armem::wm::Memory & memory)
inline

convert the references of the input into a wm::Memory

Definition at line 250 of file MemoryBase.h.

◆ setDebugObserver()

template<class _CoreSegmentT>
void setDebugObserver ( DebugObserverInterfacePrx observer)
inline

Set an optional debug observer for timing measurements.

Parameters
observerThe debug observer proxy (can be nullptr to disable)

This allows optional timing reporting to a debug observer. If set, you can report timing information like:

{
debugObserver->setDebugChannel("ChannelName", {
{"MetricName [ms]", new Variant(timeInMs)}
});
}
The Variant class is described here: Variants.
Definition Variant.h:224
DebugObserverInterfacePrx debugObserver
Optional debug observer for timing measurements.
Definition MemoryBase.h:620

Definition at line 513 of file MemoryBase.h.

+ Here is the caller graph for this function:

◆ setRecordingMode() [1/2]

template<class _CoreSegmentT>
void setRecordingMode ( const RecordingMode m)
inline

Definition at line 94 of file MemoryBase.h.

◆ setRecordingMode() [2/2]

template<class _CoreSegmentT>
void setRecordingMode ( const std::string & m)
inline

Definition at line 73 of file MemoryBase.h.

+ Here is the caller graph for this function:

◆ startRecording()

template<class _CoreSegmentT>
void startRecording ( )
inline

enable/disable

Definition at line 427 of file MemoryBase.h.

+ Here is the caller graph for this function:

◆ stopRecording()

template<class _CoreSegmentT>
void stopRecording ( )
inline

Definition at line 435 of file MemoryBase.h.

◆ store() [1/2]

template<class _CoreSegmentT>
void store ( const armem::server::wm::Memory & serverMemory)
inline

append a wm::Memory instance to the ltm

Definition at line 302 of file MemoryBase.h.

◆ store() [2/2]

template<class _CoreSegmentT>
void store ( std::shared_ptr< const armem::wm::Memory > memory)
inline

append a wm::Memory instance to the ltm (asynchronously via thread pool)

Definition at line 259 of file MemoryBase.h.

+ Here is the caller graph for this function:

◆ storeSnapshotsAsync()

template<class _CoreSegmentT>
void storeSnapshotsAsync ( const std::string & memoryName,
const std::vector< wm::EntitySnapshot > & snapshots,
const std::vector< mixin::PendingConversion::SegmentMetadata > & segmentMetadata )
inline

Store snapshots with deferred conversion (happens in async thread) This is more efficient than calling store() with a pre-converted Memory because the expensive toMemory() conversion happens off the critical path.

IMPORTANT: This method does NOT access the WM structure to avoid deadlocks. The caller must pre-extract metadata before calling this method.

Definition at line 316 of file MemoryBase.h.

Member Data Documentation

◆ debugObserver

template<class _CoreSegmentT>
DebugObserverInterfacePrx debugObserver
protected

Optional debug observer for timing measurements.

Definition at line 620 of file MemoryBase.h.

◆ enabled

template<class _CoreSegmentT>
std::atomic_bool enabled = true
protected

Definition at line 615 of file MemoryBase.h.

◆ p

template<class _CoreSegmentT>
struct armarx::armem::server::ltm::detail::MemoryBase::Properties p

◆ recordingMode

template<class _CoreSegmentT>
RecordingMode recordingMode = RecordingMode::CONSOLIDATE_REMOVED
protected

Definition at line 617 of file MemoryBase.h.

◆ statistics

template<class _CoreSegmentT>
Statistics statistics
mutableprotected

Definition at line 613 of file MemoryBase.h.


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