CSV class provides the GEOPM interface for creation of character separated value tabular data files. These CSV formatted files are created with a header containing some meta-data prefixed by the '#' character and then one line that defines the field name for the column. The separation character is a '|' not a comma.
More...
#include <CSV.hpp>
|
| CSV ()=default |
|
virtual | ~CSV ()=default |
|
virtual void | add_column (const std::string &name)=0 |
| Add a column with the given field name. The formatting of the column values will default to geopm::string_format_double(). More...
|
|
virtual void | add_column (const std::string &name, const std::string &format)=0 |
| Add a column with the given field name. The formatting of the column values chosen based on the format string. More...
|
|
virtual void | add_column (const std::string &name, std::function< std::string(double)> format)=0 |
| Add a column with the given field name. The formatting of the column values is implemented with the format function provided. More...
|
|
virtual void | activate (void)=0 |
| Calling activate indicates that all columns have been added to the object and calls to update() are enabled. More...
|
|
virtual void | update (const std::vector< double > &sample)=0 |
| Add a row to the CSV file. More...
|
|
virtual void | flush (void)=0 |
| Flush all output to the CSV file. More...
|
|
CSV class provides the GEOPM interface for creation of character separated value tabular data files. These CSV formatted files are created with a header containing some meta-data prefixed by the '#' character and then one line that defines the field name for the column. The separation character is a '|' not a comma.
◆ CSV()
◆ ~CSV()
virtual geopm::CSV::~CSV |
( |
| ) |
|
|
virtualdefault |
◆ activate()
virtual void geopm::CSV::activate |
( |
void |
| ) |
|
|
pure virtual |
Calling activate indicates that all columns have been added to the object and calls to update() are enabled.
Implemented in geopm::CSVImp.
◆ add_column() [1/3]
virtual void geopm::CSV::add_column |
( |
const std::string & |
name | ) |
|
|
pure virtual |
Add a column with the given field name. The formatting of the column values will default to geopm::string_format_double().
- Parameters
-
[in] | name | The field name for the column as it will be printed in the file header. |
Implemented in geopm::CSVImp.
◆ add_column() [2/3]
virtual void geopm::CSV::add_column |
( |
const std::string & |
name, |
|
|
const std::string & |
format |
|
) |
| |
|
pure virtual |
Add a column with the given field name. The formatting of the column values chosen based on the format string.
- Parameters
-
[in] | name | The field name for the column as it will be printed in the file header. |
[in] | format | One of five format strings:
- "double": Floating point number with up to 16 significant decimal digits.
- "float": Floating point number with up to 6 significant decimal digits.
- "integer": Whole number printed in decimal.
- "hex": Whole number printed in hexadecimal digits with 16 digits of zero padding.
- "raw64": View of raw memory contained in signal printed as a 16 hexadecimal digit number.
|
Implemented in geopm::CSVImp.
◆ add_column() [3/3]
virtual void geopm::CSV::add_column |
( |
const std::string & |
name, |
|
|
std::function< std::string(double)> |
format |
|
) |
| |
|
pure virtual |
Add a column with the given field name. The formatting of the column values is implemented with the format function provided.
- Parameters
-
[in] | name | The field name for the column as it will be printed in the file header. |
[in] | format | Function that converts a double precision signal into the printed string for this column in the CSV file. |
Implemented in geopm::CSVImp.
◆ flush()
virtual void geopm::CSV::flush |
( |
void |
| ) |
|
|
pure virtual |
◆ update()
virtual void geopm::CSV::update |
( |
const std::vector< double > & |
sample | ) |
|
|
pure virtual |
Add a row to the CSV file.
- Parameters
-
[in] | sample | Values for each column of the table in the order that the columns were added prior to calling activate(). |
Implemented in geopm::CSVImp.
The documentation for this class was generated from the following file: