ROOT
ROOT project
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
Writer< T > Class Template Reference

Class to store required arguments and handle the printing flow. More...

#include <writer_def.hpp>

Collaboration diagram for Writer< T >:
Collaboration graph

Public Member Functions

 Writer (const T &vals_to_write, WritingMethod write_method, std::string filename="output", char separator=',', bool overwrite=true)
 Constructor for a Writer object.
 
void write ()
 Method to run the printing loop and correctly initialize the Printer.
 
 Writer (const Eigen::MatrixX2d &vals_to_write, WritingMethod write_method, std::string filename, char separator, bool overwrite)
 
void write ()
 

Protected Attributes

values
 Templated values to write to allow different usage of the class.
 
WritingMethod method
 Method to write with - defined thanks to.
 
char separator
 Separator for .csv files.
 
bool overwrite
 Option to overwrite or append the output file.
 
std::string filename
 Name of the output file.
 

Private Member Functions

template<typename V >
void build_printer (std::unique_ptr< PrinterBase< V > > &printer)
 Method to convert the generic Printer into a typed one for a specific output destination.
 

Friends

class WriterBaseTester
 

Detailed Description

template<typename T>
class Writer< T >

Class to store required arguments and handle the printing flow.

Constructor & Destructor Documentation

◆ Writer() [1/2]

template<typename T >
Writer< T >::Writer ( const T &  vals_to_write,
WritingMethod  write_method,
std::string  filename = "output",
char  separator = ',',
bool  overwrite = true 
)

Constructor for a Writer object.

Parameters
vals_to_writeValues to be written, which will be stored in values argument
write_methodMethod to be used, which will be stored in method argument
separatorSeparator for .csv extension files (optional)
overwriteOption to overwrite or append to the file (optional)

◆ Writer() [2/2]

Writer< Eigen::MatrixX2d >::Writer ( const Eigen::MatrixX2d &  vals_to_write,
WritingMethod  write_method,
std::string  filename,
char  separator,
bool  overwrite 
)

Member Function Documentation

◆ build_printer()

template<typename T >
template<typename V >
void Writer< T >::build_printer ( std::unique_ptr< PrinterBase< V > > &  printer)
private

Method to convert the generic Printer into a typed one for a specific output destination.

Parameters
printerThe original abstract printer
Here is the caller graph for this function:

◆ write() [1/2]

void Writer< Eigen::MatrixX2d >::write ( )

◆ write() [2/2]

template<typename T >
void Writer< T >::write ( )

Method to run the printing loop and correctly initialize the Printer.

Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ WriterBaseTester

template<typename T >
friend class WriterBaseTester
friend

Member Data Documentation

◆ filename

template<typename T >
std::string Writer< T >::filename
protected

Name of the output file.

◆ method

template<typename T >
WritingMethod Writer< T >::method
protected

Method to write with - defined thanks to.

Author
Saransh-cpp config

◆ overwrite

template<typename T >
bool Writer< T >::overwrite
protected

Option to overwrite or append the output file.

◆ separator

template<typename T >
char Writer< T >::separator
protected

Separator for .csv files.

◆ values

template<typename T >
T Writer< T >::values
protected

Templated values to write to allow different usage of the class.


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