geopm  3.1.1.dev214+gba4f9f6d
GEOPM - Global Extensible Open Power Manager
Public Member Functions | List of all members
geopm::CSVImp Class Reference

#include <CSV.hpp>

Inheritance diagram for geopm::CSVImp:
Inheritance graph
[legend]
Collaboration diagram for geopm::CSVImp:
Collaboration graph
[legend]

Public Member Functions

 CSVImp (const std::string &file_path, const std::string &host_name, const std::string &start_time, size_t buffer_size)
 
 CSVImp (const CSVImp &other)=delete
 
CSVImpoperator= (const CSVImp &other)=delete
 
virtual ~CSVImp ()
 
void add_column (const std::string &name) override
 Add a column with the given field name. The formatting of the column values will default to geopm::string_format_double(). More...
 
void add_column (const std::string &name, const std::string &format) override
 Add a column with the given field name. The formatting of the column values chosen based on the format string. More...
 
void add_column (const std::string &name, std::function< std::string(double)> format) override
 Add a column with the given field name. The formatting of the column values is implemented with the format function provided. More...
 
void activate (void) override
 Calling activate indicates that all columns have been added to the object and calls to update() are enabled. More...
 
void update (const std::vector< double > &sample) override
 Add a row to the CSV file. More...
 
void flush (void) override
 Flush all output to the CSV file. More...
 
- Public Member Functions inherited from geopm::CSV
 CSV ()=default
 
virtual ~CSV ()=default
 

Constructor & Destructor Documentation

◆ CSVImp() [1/2]

geopm::CSVImp::CSVImp ( const std::string &  file_path,
const std::string &  host_name,
const std::string &  start_time,
size_t  buffer_size 
)

◆ CSVImp() [2/2]

geopm::CSVImp::CSVImp ( const CSVImp other)
delete

◆ ~CSVImp()

geopm::CSVImp::~CSVImp ( )
virtual

Member Function Documentation

◆ activate()

void geopm::CSVImp::activate ( void  )
overridevirtual

Calling activate indicates that all columns have been added to the object and calls to update() are enabled.

Implements geopm::CSV.

◆ add_column() [1/3]

void geopm::CSVImp::add_column ( const std::string &  name)
overridevirtual

Add a column with the given field name. The formatting of the column values will default to geopm::string_format_double().

Parameters
[in]nameThe field name for the column as it will be printed in the file header.

Implements geopm::CSV.

◆ add_column() [2/3]

void geopm::CSVImp::add_column ( const std::string &  name,
const std::string &  format 
)
overridevirtual

Add a column with the given field name. The formatting of the column values chosen based on the format string.

Parameters
[in]nameThe field name for the column as it will be printed in the file header.
[in]formatOne 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.

Implements geopm::CSV.

◆ add_column() [3/3]

void geopm::CSVImp::add_column ( const std::string &  name,
std::function< std::string(double)>  format 
)
overridevirtual

Add a column with the given field name. The formatting of the column values is implemented with the format function provided.

Parameters
[in]nameThe field name for the column as it will be printed in the file header.
[in]formatFunction that converts a double precision signal into the printed string for this column in the CSV file.

Implements geopm::CSV.

◆ flush()

void geopm::CSVImp::flush ( void  )
overridevirtual

Flush all output to the CSV file.

Implements geopm::CSV.

◆ operator=()

CSVImp& geopm::CSVImp::operator= ( const CSVImp other)
delete

◆ update()

void geopm::CSVImp::update ( const std::vector< double > &  sample)
overridevirtual

Add a row to the CSV file.

Parameters
[in]sampleValues for each column of the table in the order that the columns were added prior to calling activate().

Implements geopm::CSV.


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