AstraLog-HPC
Loading...
Searching...
No Matches
OutputManager.hpp
Go to the documentation of this file.
1
5#pragma once
6#include <fstream>
7#include <string>
8#include <vector>
9#include <Engine/Types.hpp>
11
19public:
27 OutputManager(const std::string& valid_data_path,
28 const std::string& alarms_path,
29 std::string stateful_path,
30 std::string step_diff_path);
31
37
42 void writeNominal(const Batch& data_for_timestamp);
43
49 void writeAlarms(const std::vector<std::string>& alarms);
50
56 void writeStatefulString(const std::string& state) ;
61 void writeStepDiffString(const std::string& state);
62
67 void writeStateful(const EvaluationPipeline& pipeline);
68
73 void writeStepDifference(const EvaluationPipeline& pipeline);
74
80 void readStateful(EvaluationPipeline &pipeline);
81
88
89private:
90 std::ofstream valid_file;
91 std::ofstream alarms_file;
92 std::string stateful_path;
93 std::string step_diff_path;
94};
Defines the structure of the evaluation pipeline and the function to build it based on the provided r...
Definition of the data structures and utility functions used across the Engine folder.
std::vector< DataPoint > Batch
Batch groups all the data points for a single timestamp.
Definition Types.hpp:29
Manages the writing of results to files, separating valid data from alarms.
Definition OutputManager.hpp:18
void writeNominal(const Batch &data_for_timestamp)
Writes a single aggregated line for a timestamp without anomalies.
Definition OutputManager.cpp:26
void writeStepDifference(const EvaluationPipeline &pipeline)
Writes step-difference-rule state by introspecting the pipeline (single-process path / unit tests).
Definition OutputManager.cpp:80
void writeStateful(const EvaluationPipeline &pipeline)
Writes stateful-rule state by introspecting the pipeline (single-process path / unit tests).
Definition OutputManager.cpp:68
void writeStatefulString(const std::string &state)
Writes the state of stateful rules to a file for use in the next batch.
Definition OutputManager.cpp:57
~OutputManager()
Destructor of the class.
Definition OutputManager.cpp:20
std::ofstream alarms_file
output file stream for alarms
Definition OutputManager.hpp:91
std::ofstream valid_file
output file stream for valid (nominal) data
Definition OutputManager.hpp:90
void writeStepDiffString(const std::string &state)
Writes the state of step difference rules to a file for use in the next batch.
Definition OutputManager.cpp:61
void writeAlarms(const std::vector< std::string > &alarms)
Writes the alarm lines for non-nominal timestamps.
Definition OutputManager.cpp:48
std::string step_diff_path
path to the step difference rules state file
Definition OutputManager.hpp:93
void readStateful(EvaluationPipeline &pipeline)
Reads the state of stateful rules from a file to update the evaluation pipeline for the current batch...
Definition OutputManager.cpp:92
void readStepDifference(EvaluationPipeline &pipeline)
Reads the state of step difference rules from a file to update the evaluation pipeline for the curren...
Definition OutputManager.cpp:124
std::string stateful_path
path to the stateful rules state file
Definition OutputManager.hpp:92
Holds the categorized and organized rules ready for execution.
Definition RuleOrdering.hpp:17