Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DataIO_Text Class Reference

DataIO_Text class for general file I/O in plain Text format. More...

#include <dataIO_Text.h>

Inheritance diagram for DataIO_Text:
DataIO

Public Member Functions

 DataIO_Text ()
 
 ~DataIO_Text ()
 
virtual void read_file (double *v, const size_t n, const string &f)
 
virtual void write_file (const double *v, const size_t n, const string &f, const bool append=true)
 
virtual void read_file (dcomplex *v, const size_t n, const string &f)
 
virtual void write_file (const dcomplex *v, const size_t n, const string &f, const bool append=true)
 
virtual void read_file (std::vector< double > &v, const string &f)
 
virtual void write_file (const std::vector< double > &v, const string &f, const bool append=true)
 
virtual void read_file (std::vector< dcomplex > &v, const string &f)
 
virtual void write_file (const std::vector< dcomplex > &v, const string &f, const bool append=true)
 
void set_parameter (const int precision)
 
- Public Member Functions inherited from DataIO
 DataIO ()
 
virtual ~DataIO ()
 

Private Member Functions

template<typename T >
void read_file_base (T *v, const size_t n, const string &)
 
template<typename T >
void write_file_base (const T *v, const size_t n, const string &, const bool append=true)
 
template<typename T >
void fetch_data (T &v, fstream &fs)
 
template<typename T >
void store_data (const T &v, fstream &fs)
 
template<>
void store_data (const double &v, fstream &fs)
 
template<>
void store_data (const dcomplex &v, fstream &fs)
 
template<>
void fetch_data (double &v, fstream &fs)
 
template<>
void fetch_data (dcomplex &v, fstream &fs)
 

Private Attributes

int m_format_precision
 

Additional Inherited Members

- Protected Attributes inherited from DataIO
Bridge::VerboseLevel m_vl
 

Detailed Description

DataIO_Text class for general file I/O in plain Text format.

DataIO_Text class provides file I/O in plain Text format. output format of numerical precision can be specified through set_parameter method. default is given as enum.

Data are read from/written to file through the primary node (rank 0 usually).

The read/write methods in various data formats are all derived from template functions whose implementation given in dataIO_Text_impl.h included at the bottom.

Definition at line 44 of file dataIO_Text.h.

Constructor & Destructor Documentation

DataIO_Text::DataIO_Text ( )
inline

Definition at line 47 of file dataIO_Text.h.

DataIO_Text::~DataIO_Text ( )
inline

Definition at line 48 of file dataIO_Text.h.

Member Function Documentation

template<>
void DataIO_Text::fetch_data ( double &  v,
fstream &  fs 
)
inlineprivate

Definition at line 84 of file dataIO_Text_impl.h.

template<typename T >
void DataIO_Text::fetch_data ( T &  v,
fstream &  fs 
)
inlineprivate
template<>
void DataIO_Text::fetch_data ( dcomplex &  v,
fstream &  fs 
)
inlineprivate

Definition at line 95 of file dataIO_Text_impl.h.

virtual void DataIO_Text::read_file ( double *  v,
const size_t  n,
const string &  f 
)
inlinevirtual

Implements DataIO.

Definition at line 50 of file dataIO_Text.h.

virtual void DataIO_Text::read_file ( dcomplex *  v,
const size_t  n,
const string &  f 
)
inlinevirtual

Implements DataIO.

Definition at line 55 of file dataIO_Text.h.

virtual void DataIO_Text::read_file ( std::vector< double > &  v,
const string &  f 
)
inlinevirtual

Implements DataIO.

Definition at line 60 of file dataIO_Text.h.

virtual void DataIO_Text::read_file ( std::vector< dcomplex > &  v,
const string &  f 
)
inlinevirtual

Implements DataIO.

Definition at line 70 of file dataIO_Text.h.

template<typename T >
void DataIO_Text::read_file_base ( T *  v,
const size_t  n,
const string &  filename 
)
private

Definition at line 18 of file dataIO_Text_impl.h.

void DataIO_Text::set_parameter ( const int  precision)
inline

Definition at line 80 of file dataIO_Text.h.

template<>
void DataIO_Text::store_data ( const double &  v,
fstream &  fs 
)
inlineprivate

Definition at line 68 of file dataIO_Text_impl.h.

template<>
void DataIO_Text::store_data ( const dcomplex &  v,
fstream &  fs 
)
inlineprivate

Definition at line 76 of file dataIO_Text_impl.h.

template<typename T >
void DataIO_Text::store_data ( const T &  v,
fstream &  fs 
)
inlineprivate
virtual void DataIO_Text::write_file ( const double *  v,
const size_t  n,
const string &  f,
const bool  append = true 
)
inlinevirtual

Implements DataIO.

Definition at line 52 of file dataIO_Text.h.

virtual void DataIO_Text::write_file ( const dcomplex *  v,
const size_t  n,
const string &  f,
const bool  append = true 
)
inlinevirtual

Implements DataIO.

Definition at line 57 of file dataIO_Text.h.

virtual void DataIO_Text::write_file ( const std::vector< double > &  v,
const string &  f,
const bool  append = true 
)
inlinevirtual

Implements DataIO.

Definition at line 62 of file dataIO_Text.h.

virtual void DataIO_Text::write_file ( const std::vector< dcomplex > &  v,
const string &  f,
const bool  append = true 
)
inlinevirtual

Implements DataIO.

Definition at line 72 of file dataIO_Text.h.

template<typename T >
void DataIO_Text::write_file_base ( const T *  v,
const size_t  n,
const string &  filename,
const bool  append = true 
)
private

Definition at line 41 of file dataIO_Text_impl.h.

Member Data Documentation

int DataIO_Text::m_format_precision
private

Definition at line 83 of file dataIO_Text.h.


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