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

Defines the structure of the evaluation pipeline and the function to build it based on the provided rule configurations. More...

#include <unordered_map>
#include <vector>
#include <memory>
#include "Strategy.hpp"
Include dependency graph for RuleOrdering.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  EvaluationPipeline
 Holds the categorized and organized rules ready for execution. More...
 

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

Defines the structure of the evaluation pipeline and the function to build it based on the provided rule configurations.

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.