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

Coordinates the loading of rules, processing of data batches, and writing of results. More...

#include <RunEngine.hpp>

Collaboration diagram for Engine:
Collaboration graph

Public Member Functions

 Engine (const std::string &output_path, const std::string &alarms_path, const std::string &stateful_path, const std::string &step_diff_path)
 Constructs an Engine with explicit output file paths.
 
void loadRules (const std::string &path)
 Loads the evaluation rules from the specified path and initializes the RulesFactory.
 
size_t get_num_sensors (const std::string &path)
 Retrieves the total number of sensors configured in the system.
 
void run (const std::string &batch_path, size_t num_sensors)
 Processes a batch of data points received from the collector/validator.
 

Private Attributes

std::unique_ptr< RulesFactory > rulesFactory
 Factory responsible for creating and managing rule strategies.
 
std::unique_ptr< OutputManager > outputManager
 Manager handling the file streams for results and alarms.
 
std::unique_ptr< Evaluate > evaluator
 Component responsible for evaluating data against the loaded rules.
 
Batch current_batch
 The internal batch of data currently being processed.
 

Detailed Description

Coordinates the loading of rules, processing of data batches, and writing of results.

Constructor & Destructor Documentation

◆ Engine()

Engine::Engine ( const std::string &  output_path,
const std::string &  alarms_path,
const std::string &  stateful_path,
const std::string &  step_diff_path 
)
inline

Constructs an Engine with explicit output file paths.

Parameters
output_pathPath where valid data will be written.
alarms_pathPath where alarms will be written.
stateful_pathPath to the stateful-rule cross-batch state file.
step_diff_pathPath to the step-difference cross-batch state file.

Member Function Documentation

◆ get_num_sensors()

size_t Engine::get_num_sensors ( const std::string &  path)

Retrieves the total number of sensors configured in the system.

Parameters
pathThe file path to the configuration or data source used to determine the sensor count.
Returns
The total number of sensors as a size_t.
Exceptions
astralog::IoErrorif the file cannot be opened.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadRules()

void Engine::loadRules ( const std::string &  path)
inline

Loads the evaluation rules from the specified path and initializes the RulesFactory.

Parameters
pathThe file or directory path containing the rules configuration.
Here is the caller graph for this function:

◆ run()

void Engine::run ( const std::string &  batch_path,
size_t  num_sensors 
)

Processes a batch of data points received from the collector/validator.

Note
The batch is expected to be read from the location where it is copied via SCP.
Parameters
batch_pathThe file path of the incoming data batch to process.
num_sensorsThe number of sensors involved in the current execution.
Exceptions
astralog::ConfigErrorif the rules are not properly loaded or if the batch size is not a multiple of the number of sensors.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ current_batch

Batch Engine::current_batch
private

The internal batch of data currently being processed.

◆ evaluator

std::unique_ptr<Evaluate> Engine::evaluator
private

Component responsible for evaluating data against the loaded rules.

◆ outputManager

std::unique_ptr<OutputManager> Engine::outputManager
private

Manager handling the file streams for results and alarms.

◆ rulesFactory

std::unique_ptr<RulesFactory> Engine::rulesFactory
private

Factory responsible for creating and managing rule strategies.


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