AstraLog-HPC
Loading...
Searching...
No Matches
RulesFactory Class Reference

Instantiates rule objects from a JSON config and assembles them into an EvaluationPipeline. More...

#include <RulesFactory.hpp>

Collaboration diagram for RulesFactory:
Collaboration graph

Public Member Functions

 RulesFactory (const std::string &rules_path)
 Builds the rule map and evaluation pipeline from a rules JSON file.
 
EvaluationPipeline & getPipeline ()
 Returns the evaluation pipeline (primary rules per sensor plus correlation rules).
 
const std::unordered_map< std::string, std::shared_ptr< RuleStrategy > > & getRuleMap () const
 Returns the map of rule ID to its instantiated rule strategy.
 

Static Private Member Functions

static void loadFactory ()
 

Private Attributes

std::unordered_map< std::string, std::shared_ptr< RuleStrategy > > ruleMap
 
EvaluationPipeline pipeline
 

Detailed Description

Instantiates rule objects from a JSON config and assembles them into an EvaluationPipeline.

Registers the rule builders once, creates one RuleStrategy per config entry via the GenericFactory, and groups/sorts them with buildPipeline(). Entries that fail to instantiate are logged and skipped.

Constructor & Destructor Documentation

◆ RulesFactory()

RulesFactory::RulesFactory ( const std::string &  rules_path)
inlineexplicit

Builds the rule map and evaluation pipeline from a rules JSON file.

Parameters
rules_pathPath to the rules JSON file.
Here is the call graph for this function:

Member Function Documentation

◆ getPipeline()

EvaluationPipeline & RulesFactory::getPipeline ( )
inline

Returns the evaluation pipeline (primary rules per sensor plus correlation rules).

Returns
Reference to the assembled EvaluationPipeline.
Here is the caller graph for this function:

◆ getRuleMap()

const std::unordered_map< std::string, std::shared_ptr< RuleStrategy > > & RulesFactory::getRuleMap ( ) const
inline

Returns the map of rule ID to its instantiated rule strategy.

Returns
Const reference to the rule map.

◆ loadFactory()

static void RulesFactory::loadFactory ( )
inlinestaticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ pipeline

EvaluationPipeline RulesFactory::pipeline
private

◆ ruleMap

std::unordered_map<std::string, std::shared_ptr<RuleStrategy> > RulesFactory::ruleMap
private

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