Processors Class Reference

all necessary classes to filter and convert an entry of the ltm to some other format(s) More...

#include <RobotAPI/libraries/armem/server/ltm/processors/Processors.h>

Public Member Functions

bool acceptSnapshotForSegment (const std::string &coreSegmentName, const std::string &providerSegmentName, const armem::wm::EntitySnapshot &snapshot, bool simulatedVersion=false)
 Decide whether a snapshot of the given segment should be stored to LTM.
 
void configure (const nlohmann::json &config)
 
std::map< std::string, processor::SnapshotFilter::FilterStatistics > getSnapshotFilterStatistics ()
 
bool hasSegmentSelection () const
 Whether any segment-based selection or per-segment filtering is configured.
 
 Processors ()=default
 
void resetFilterStatisticsForNewEpisode ()
 resetFilterStatisticsForNewEpisode runs resetFilterStatisticsForNewEpisode on all snapshot filters
 

Public Attributes

std::vector< std::unique_ptr< processor::DataConverter > > converters
 
processor::converter::data::object::JsonConverter defaultObjectConverter
 
processor::converter::type::object::JsonConverter defaultTypeConverter
 
std::vector< std::unique_ptr< processor::Extractor > > extractors
 
std::vector< std::unique_ptr< processor::MemoryFilter > > memFilters
 
std::map< std::string, std::vector< std::unique_ptr< processor::SnapshotFilter > > > segmentSnapFilters
 Per-segment snapshot filter overrides, keyed by "CoreSegment" or "CoreSegment/ProviderSegment".
 
std::vector< std::unique_ptr< processor::SnapshotFilter > > snapFilters
 
std::optional< std::set< std::string > > storeSegments
 Optional whitelist of segments to store.
 

Detailed Description

all necessary classes to filter and convert an entry of the ltm to some other format(s)

Constructor & Destructor Documentation

◆ Processors()

Processors ( )
default

Member Function Documentation

◆ acceptSnapshotForSegment()

bool acceptSnapshotForSegment ( const std::string & coreSegmentName,
const std::string & providerSegmentName,
const armem::wm::EntitySnapshot & snapshot,
bool simulatedVersion = false )

Decide whether a snapshot of the given segment should be stored to LTM.

Combines two mechanisms configured via the LTM configuration JSON:

  1. Segment whitelist (storeSegments): if set, the snapshot is rejected unless its segment is admitted. A core segment is admitted if either its core-segment name ("Core") or its provider-segment path ("Core/Provider") is listed.
  2. Snapshot filters: per-segment filter overrides (segments) are applied if present for this segment (provider path takes precedence over core), otherwise the global snapFilters are applied.

If neither storeSegments nor segmentSnapFilters is configured, this falls back to the global snapshot filters only, reproducing the previous behavior.

◆ configure()

void configure ( const nlohmann::json & config)

◆ getSnapshotFilterStatistics()

std::map< std::string, processor::SnapshotFilter::FilterStatistics > getSnapshotFilterStatistics ( )

◆ hasSegmentSelection()

bool hasSegmentSelection ( ) const

Whether any segment-based selection or per-segment filtering is configured.

When false, callers may use the global snapFilters directly.

◆ resetFilterStatisticsForNewEpisode()

void resetFilterStatisticsForNewEpisode ( )

resetFilterStatisticsForNewEpisode runs resetFilterStatisticsForNewEpisode on all snapshot filters

Member Data Documentation

◆ converters

std::vector<std::unique_ptr<processor::DataConverter> > converters

◆ defaultObjectConverter

◆ defaultTypeConverter

◆ extractors

std::vector<std::unique_ptr<processor::Extractor> > extractors

◆ memFilters

std::vector<std::unique_ptr<processor::MemoryFilter> > memFilters

◆ segmentSnapFilters

std::map<std::string, std::vector<std::unique_ptr<processor::SnapshotFilter> > > segmentSnapFilters

Per-segment snapshot filter overrides, keyed by "CoreSegment" or "CoreSegment/ProviderSegment".

A segment without an entry uses snapFilters.

◆ snapFilters

std::vector<std::unique_ptr<processor::SnapshotFilter> > snapFilters

◆ storeSegments

std::optional<std::set<std::string> > storeSegments

Optional whitelist of segments to store.

Absent => store all segments. Entries are either "CoreSegment" or "CoreSegment/ProviderSegment".


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