#include <CSVExporter.h>
Definition at line 10 of file CSVExporter.h.
Definition at line 40 of file CSVExporter.cxx.
44 throw std::runtime_error(
"Failed to open output file");
47 ofile << std::setprecision(std::numeric_limits<double>::max_digits10);
void CSVExporter::addScalarVar |
( |
const std::string & |
name | ) |
|
Definition at line 91 of file CSVExporter.cxx.
std::vector< std::string > scalVarNames
void CSVExporter::addVectorVar |
( |
const std::string & |
name | ) |
|
Definition at line 98 of file CSVExporter.cxx.
std::vector< std::string > vectVarNames
void CSVExporter::exportVars |
( |
const VarDict & |
vars | ) |
|
Definition at line 105 of file CSVExporter.cxx.
111 bool firstValuePrinted =
false;
113 firstValuePrinted = printSeparatedValues<std::string, char>(
118 if (it != vars.
scalar.end()) {
119 output << it->second;
124 firstValuePrinted = printSeparatedValues<std::string, char>(
131 if (it != vars.
vector.end()) {
132 printSeparatedValues<double, char>(
133 output, it->second,
false,
',',
134 [] (
auto &
output,
const auto x) { output <<
x; }
std::vector< std::string > scalVarNames
void init(const VarDict &vars)
std::unordered_map< std::string, std::vector< double > > vector
std::vector< std::string > vectVarNames
QTextStream & endl(QTextStream &s)
std::unordered_map< std::string, double > scalar
void CSVExporter::init |
( |
const VarDict & |
vars | ) |
|
|
protected |
Definition at line 72 of file CSVExporter.cxx.
75 for (
const auto &kval : vars.
scalar) {
79 for (
const auto &kval : vars.
vector) {
std::vector< std::string > scalVarNames
std::unordered_map< std::string, std::vector< double > > vector
std::vector< std::string > vectVarNames
std::unordered_map< std::string, double > scalar
void CSVExporter::printHeader |
( |
| ) |
|
|
protected |
Definition at line 55 of file CSVExporter.cxx.
57 bool firstValuePrinted =
false;
59 firstValuePrinted = printSeparatedValues<std::string, char>(
64 printSeparatedValues<std::string, char>(
std::vector< std::string > scalVarNames
std::vector< std::string > vectVarNames
QTextStream & endl(QTextStream &s)
void CSVExporter::setPrecision |
( |
int |
precision | ) |
|
bool CSVExporter::initialized |
|
protected |
std::ofstream CSVExporter::ofile |
|
protected |
The documentation for this class was generated from the following files: