Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
ModelWriter Class Reference

High-level helper for writing modified model code and parameter files. More...

#include <ModelWriter.h>

Public Member Functions

 ModelWriter (LineProcessor &lineProcessor, ParamWriter &paramwriter)
 Constructs a ModelWriter with the given helpers.
 
void writeModel (std::ifstream &inputFile, std::ofstream &outputFile)
 Processes the model source and writes the transformed file.
 
void writeParam (std::ofstream &paramFile, const std::unordered_map< std::string, double > &params)
 Writes parameters to the parameter file.
 

Detailed Description

High-level helper for writing modified model code and parameter files.

ModelWriter:

  • reads an input C++ model file and passes each line through a LineProcessor to inject IO logic,
  • writes parameter values (from a map of name → value) using ParamWriter.

Definition at line 28 of file ModelWriter.h.

Constructor & Destructor Documentation

◆ ModelWriter()

ModelWriter::ModelWriter ( LineProcessor lineProcessor,
ParamWriter paramwriter 
)

Constructs a ModelWriter with the given helpers.

Parameters
lineProcessorReference to a configured LineProcessor.
paramwriterReference to a ParamWriter instance.

Definition at line 3 of file ModelWriter.cpp.

Member Function Documentation

◆ writeModel()

void ModelWriter::writeModel ( std::ifstream &  inputFile,
std::ofstream &  outputFile 
)

Processes the model source and writes the transformed file.

Reads inputFile line by line and forwards each line through LineProcessor::processLine, writing the result to outputFile.

Parameters
inputFileOpen input stream referring to the original model file.
outputFileOpen output stream where the modified code is written.

Definition at line 5 of file ModelWriter.cpp.

◆ writeParam()

void ModelWriter::writeParam ( std::ofstream &  paramFile,
const std::unordered_map< std::string, double > &  params 
)

Writes parameters to the parameter file.

Uses ParamWriter::writeParams to emit lines of the form name,value into paramFile.

Parameters
paramFileOpen output stream for the parameter file.
paramsMap from parameter name to value.

Definition at line 12 of file ModelWriter.cpp.


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