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::FilterStatisticsgetSnapshotFilterStatistics ()
 
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)

Definition at line 21 of file Processors.h.

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.

Definition at line 123 of file Processors.cpp.

◆ configure()

void configure ( const nlohmann::json & config)

Definition at line 45 of file Processors.cpp.

◆ getSnapshotFilterStatistics()

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

Definition at line 159 of file Processors.cpp.

◆ hasSegmentSelection()

bool hasSegmentSelection ( ) const

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

When false, callers may use the global snapFilters directly.

Definition at line 93 of file Processors.cpp.

◆ resetFilterStatisticsForNewEpisode()

void resetFilterStatisticsForNewEpisode ( )

resetFilterStatisticsForNewEpisode runs resetFilterStatisticsForNewEpisode on all snapshot filters

Definition at line 201 of file Processors.cpp.

Member Data Documentation

◆ converters

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

Definition at line 92 of file Processors.h.

◆ defaultObjectConverter

Definition at line 95 of file Processors.h.

◆ defaultTypeConverter

Definition at line 96 of file Processors.h.

◆ extractors

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

Definition at line 89 of file Processors.h.

◆ memFilters

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

Definition at line 74 of file Processors.h.

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

Definition at line 86 of file Processors.h.

◆ snapFilters

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

Definition at line 77 of file Processors.h.

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

Definition at line 81 of file Processors.h.


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