EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dfe::io_dsv_impl::DsvWriter< Delimiter > Class Template Reference

Write arbitrary data as delimiter-separated values into a text file. More...

#include <acts/blob/sPHENIX/thirdparty/dfelibs/dfe/dfe_io_dsv.hpp>

+ Collaboration diagram for dfe::io_dsv_impl::DsvWriter< Delimiter >:

Public Member Functions

 DsvWriter ()=delete
 
 DsvWriter (const DsvWriter &)=delete
 
 DsvWriter (DsvWriter &&)=default
 
 ~DsvWriter ()=default
 
DsvWriteroperator= (const DsvWriter &)=delete
 
DsvWriteroperator= (DsvWriter &&)=default
 
 DsvWriter (const std::vector< std::string > &columns, const std::string &path, int precision=std::numeric_limits< double >::max_digits10)
 
template<typename Arg0 , typename... Args>
void append (Arg0 &&arg0, Args &&...args)
 

Static Private Member Functions

template<typename T >
static std::enable_if_t
< std::is_arithmetic
< std::decay_t< T > >::value
or std::is_convertible< T,
std::string >::value, unsigned > 
write (T &&x, std::ostream &os)
 
template<typename T , typename Allocator >
static unsigned write (const std::vector< T, Allocator > &xs, std::ostream &os)
 

Private Attributes

std::ofstream m_file
 
std::size_t m_num_columns
 

Detailed Description

template<char Delimiter>
class dfe::io_dsv_impl::DsvWriter< Delimiter >

Write arbitrary data as delimiter-separated values into a text file.

Definition at line 46 of file dfe_io_dsv.hpp.

View newest version in sPHENIX GitHub at line 46 of file dfe_io_dsv.hpp

Constructor & Destructor Documentation

template<char Delimiter>
dfe::io_dsv_impl::DsvWriter< Delimiter >::DsvWriter ( )
delete
template<char Delimiter>
dfe::io_dsv_impl::DsvWriter< Delimiter >::DsvWriter ( const DsvWriter< Delimiter > &  )
delete
template<char Delimiter>
dfe::io_dsv_impl::DsvWriter< Delimiter >::DsvWriter ( DsvWriter< Delimiter > &&  )
default
template<char Delimiter>
dfe::io_dsv_impl::DsvWriter< Delimiter >::~DsvWriter ( )
default
template<char Delimiter>
dfe::io_dsv_impl::DsvWriter< Delimiter >::DsvWriter ( const std::vector< std::string > &  columns,
const std::string &  path,
int  precision = std::numeric_limits<double>::max_digits10 
)
inline

Create a file at the given path. Overwrites existing data.

Parameters
columnsColumn names, fixes the number of columns for the file
pathPath to the output file
precisionOutput floating point precision

Definition at line 261 of file dfe_io_dsv.hpp.

View newest version in sPHENIX GitHub at line 261 of file dfe_io_dsv.hpp

References dfe::io_dsv_impl::DsvWriter< Delimiter >::append(), dfe::io_dsv_impl::DsvWriter< Delimiter >::m_file, and dfe::io_dsv_impl::DsvWriter< Delimiter >::m_num_columns.

+ Here is the call graph for this function:

Member Function Documentation

template<char Delimiter>
template<typename Arg0 , typename... Args>
void dfe::io_dsv_impl::DsvWriter< Delimiter >::append ( Arg0 &&  arg0,
Args &&...  args 
)
inline

Append arguments as a new row to the file.

Each argument corresponds to one column. The writer ensures that the number of columns written match the number of columns that were specified during construction.

Note
std::vector arguments are automatically unpacked and each entry is written as a separate column.

Definition at line 281 of file dfe_io_dsv.hpp.

View newest version in sPHENIX GitHub at line 281 of file dfe_io_dsv.hpp

References charm_jet_coverage::args, value, and tree::write().

Referenced by dfe::io_dsv_impl::DsvWriter< Delimiter >::DsvWriter().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<char Delimiter>
DsvWriter& dfe::io_dsv_impl::DsvWriter< Delimiter >::operator= ( const DsvWriter< Delimiter > &  )
delete
template<char Delimiter>
DsvWriter& dfe::io_dsv_impl::DsvWriter< Delimiter >::operator= ( DsvWriter< Delimiter > &&  )
default
template<char Delimiter>
template<typename T >
std::enable_if_t< std::is_arithmetic< std::decay_t< T > >::value or std::is_convertible< T, std::string >::value, unsigned > dfe::io_dsv_impl::DsvWriter< Delimiter >::write ( T &&  x,
std::ostream &  os 
)
inlinestaticprivate

Definition at line 322 of file dfe_io_dsv.hpp.

View newest version in sPHENIX GitHub at line 322 of file dfe_io_dsv.hpp

References Acts::UnitConstants::u, and x.

template<char Delimiter>
template<typename T , typename Allocator >
unsigned dfe::io_dsv_impl::DsvWriter< Delimiter >::write ( const std::vector< T, Allocator > &  xs,
std::ostream &  os 
)
inlinestaticprivate

Definition at line 330 of file dfe_io_dsv.hpp.

View newest version in sPHENIX GitHub at line 330 of file dfe_io_dsv.hpp

References n, and x.

Member Data Documentation

template<char Delimiter>
std::ofstream dfe::io_dsv_impl::DsvWriter< Delimiter >::m_file
private

Definition at line 76 of file dfe_io_dsv.hpp.

View newest version in sPHENIX GitHub at line 76 of file dfe_io_dsv.hpp

Referenced by dfe::io_dsv_impl::DsvWriter< Delimiter >::DsvWriter().

template<char Delimiter>
std::size_t dfe::io_dsv_impl::DsvWriter< Delimiter >::m_num_columns
private

Definition at line 77 of file dfe_io_dsv.hpp.

View newest version in sPHENIX GitHub at line 77 of file dfe_io_dsv.hpp

Referenced by dfe::io_dsv_impl::DsvWriter< Delimiter >::DsvWriter().


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