Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
ModelWriter.cpp
Go to the documentation of this file.
1#include "ModelWriter.h"
2
3ModelWriter::ModelWriter(LineProcessor& lineProcessor, ParamWriter& paramwriter) : lineProcessor(lineProcessor), paramwriter(paramwriter) {}
4
5void ModelWriter::writeModel(std::ifstream& inputFile, std::ofstream& outputFile) {
6 std::string line;
7 while (std::getline(inputFile, line)) {
8 lineProcessor.processLine(outputFile, line);
9 }
10}
11
12void ModelWriter::writeParam(std::ofstream& paramFile, const std::unordered_map<std::string, double>& params) {
13 paramwriter.writeParams(paramFile, params);
14}
Declares a helper that writes processed model code and parameters.
Processes lines of a template C++ file and injects custom code.
void processLine(std::ofstream &outputFile, const std::string &currentLine)
Processes a single line of input and writes to the output file.
void writeParam(std::ofstream &paramFile, const std::unordered_map< std::string, double > &params)
Writes parameters to the parameter file.
void writeModel(std::ifstream &inputFile, std::ofstream &outputFile)
Processes the model source and writes the transformed file.
ModelWriter(LineProcessor &lineProcessor, ParamWriter &paramwriter)
Constructs a ModelWriter with the given helpers.
Helper class to serialize parameter values to a text stream.
Definition ParamWriter.h:29
void writeParams(std::ofstream &outputFile, const std::unordered_map< std::string, double > &params)
Writes a map of parameters to an output stream.