AstraLog-HPC
Loading...
Searching...
No Matches
RuleOrdering.cpp File Reference

Contains the implementation for building the evaluation pipeline. More...

#include <unordered_map>
#include <vector>
#include <RulesFactory/RuleOrdering.hpp>
#include <common/errors.hpp>
#include <string>
#include <algorithm>
#include <iostream>
#include <iomanip>
Include dependency graph for RuleOrdering.cpp:

Functions

EvaluationPipeline buildPipeline (const std::unordered_map< std::string, std::shared_ptr< RuleStrategy > > &ruleMap, const std::vector< RuleConfig > &configs)
 Builds an evaluation pipeline by organizing and sorting rules.
 
void printpipeline (EvaluationPipeline &pipeline)
 Prints the structure and contents of the given evaluation pipeline for debugging or logging.
 

Detailed Description

Contains the implementation for building the evaluation pipeline.

Function Documentation

◆ buildPipeline()

EvaluationPipeline buildPipeline ( const std::unordered_map< std::string, std::shared_ptr< RuleStrategy > > &  ruleMap,
const std::vector< RuleConfig > &  configs 
)

Builds an evaluation pipeline by organizing and sorting rules.

Categorizes the instantiated rules: correlation rules are separated from primary rules, which are grouped by their target sensor ID and then sorted within each group by execution priority (HIGH > MEDIUM > LOW). Throws astralog::RuleError if a config references an unknown rule id.

Parameters
ruleMapA map associating rule IDs with their corresponding instantiated RuleStrategy objects.
configsA vector of RuleConfig objects containing the metadata for each rule.
Returns
EvaluationPipeline The constructed pipeline ready for evaluation.
Here is the caller graph for this function:

◆ printpipeline()

void printpipeline ( EvaluationPipeline &  pipeline)

Prints the structure and contents of the given evaluation pipeline for debugging or logging.

Renders the execution order as an ASCII tree in two stages — primary rules (grouped by sensor, with their priorities) then correlation rules. Empty stages are labelled explicitly.

Parameters
pipelineThe EvaluationPipeline object to print.