OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
SDDSWriter Class Reference

#include <SDDSWriter.h>

Inheritance diagram for SDDSWriter:
Inheritance graph
[legend]
Collaboration diagram for SDDSWriter:
Collaboration graph
[legend]

Public Types

typedef std::pair< std::string, std::string > desc_t
 
typedef std::tuple< std::string, std::string, std::string > param_t
 
typedef std::pair< std::string, size_t > data_t
 
typedef std::tuple< std::string, std::string, std::string, std::string > cols_t
 

Public Member Functions

 SDDSWriter (const std::string &fname, bool restart)
 
virtual ~SDDSWriter ()
 
virtual void write (const PartBunchBase< double, 3 > *)
 
void rewindLines (size_t numberOfLines)
 delete the last 'numberOfLines' lines of the file 'fileName' More...
 
void replaceVersionString ()
 
double getLastValue (const std::string &column)
 
bool exists () const
 

Protected Member Functions

void addDescription (const std::string &text, const std::string &content)
 
template<typename T >
void addParameter (const std::string &name, const std::string &type, const std::string &desc, const T &value)
 
void addDefaultParameters ()
 
void addColumn (const std::string &name, const std::string &type, const std::string &unit, const std::string &desc)
 
void addInfo (const std::string &mode, const size_t &no_row_counts)
 
void writeRow ()
 
void open ()
 
void close ()
 
void writeHeader ()
 Write SDDS header. More...
 
template<typename T >
std::string toString (const T &val)
 
bool hasColumns () const
 

Protected Attributes

std::string fname_m
 
std::ios_base::openmode mode_m
 First write to the statistics output file. More...
 
SDDSColumnSet columns_m
 

Private Member Functions

void writeDescription ()
 
void writeParameters ()
 
void writeColumns ()
 
void writeInfo ()
 

Private Attributes

std::ofstream os_m
 
std::string indent_m
 
desc_t desc_m
 
std::queue< param_tparams_m
 
std::queue< std::string > paramValues_m
 
data_t info_m
 

Static Private Attributes

static constexpr unsigned int precision_m = 15
 

Detailed Description

Definition at line 41 of file SDDSWriter.h.

Member Typedef Documentation

◆ cols_t

typedef std::tuple<std::string, std::string, std::string, std::string> SDDSWriter::cols_t

Definition at line 59 of file SDDSWriter.h.

◆ data_t

typedef std::pair<std::string, size_t> SDDSWriter::data_t

Definition at line 53 of file SDDSWriter.h.

◆ desc_t

typedef std::pair<std::string, std::string> SDDSWriter::desc_t

Definition at line 45 of file SDDSWriter.h.

◆ param_t

typedef std::tuple<std::string, std::string, std::string> SDDSWriter::param_t

Definition at line 50 of file SDDSWriter.h.

Constructor & Destructor Documentation

◆ SDDSWriter()

SDDSWriter::SDDSWriter ( const std::string &  fname,
bool  restart 
)

Definition at line 32 of file SDDSWriter.cpp.

References endl(), fname_m, Hypervolume::fs, INFOMSG, and mode_m.

Here is the call graph for this function:

◆ ~SDDSWriter()

virtual SDDSWriter::~SDDSWriter ( )
inlinevirtual

Definition at line 64 of file SDDSWriter.h.

Member Function Documentation

◆ addColumn()

void SDDSWriter::addColumn ( const std::string &  name,
const std::string &  type,
const std::string &  unit,
const std::string &  desc 
)
protected

◆ addDefaultParameters()

void SDDSWriter::addDefaultParameters ( )
protected

◆ addDescription()

void SDDSWriter::addDescription ( const std::string &  text,
const std::string &  content 
)
inlineprotected

◆ addInfo()

void SDDSWriter::addInfo ( const std::string &  mode,
const size_t &  no_row_counts 
)
inlineprotected

◆ addParameter()

template<typename T >
void SDDSWriter::addParameter ( const std::string &  name,
const std::string &  type,
const std::string &  desc,
const T &  value 
)
protected

Definition at line 172 of file SDDSWriter.h.

References name, params_m, and paramValues_m.

Referenced by addDefaultParameters().

◆ close()

void SDDSWriter::close ( )
protected

◆ exists()

bool SDDSWriter::exists ( ) const
inline

Definition at line 158 of file SDDSWriter.h.

References fname_m.

◆ getLastValue()

double SDDSWriter::getLastValue ( const std::string &  column)

Definition at line 125 of file SDDSWriter.cpp.

References fname_m, SDDS::SDDSParser::getValue(), and SDDS::SDDSParser::run().

Here is the call graph for this function:

◆ hasColumns()

bool SDDSWriter::hasColumns ( ) const
inlineprotected

◆ open()

void SDDSWriter::open ( )
protected

◆ replaceVersionString()

void SDDSWriter::replaceVersionString ( )

◆ rewindLines()

void SDDSWriter::rewindLines ( size_t  numberOfLines)

delete the last 'numberOfLines' lines of the file 'fileName'

Definition at line 48 of file SDDSWriter.cpp.

References fname_m, Hypervolume::fs, and IpplInfo::myNode().

Here is the call graph for this function:

◆ toString()

template<typename T >
std::string SDDSWriter::toString ( const T &  val)
protected

Definition at line 198 of file SDDSWriter.h.

References precision_m.

Referenced by MemoryProfiler::write(), and GridLBalWriter::write().

◆ write()

virtual void SDDSWriter::write ( const PartBunchBase< double, 3 > *  )
inlinevirtual

Reimplemented in MemoryWriter, and MemoryProfiler.

Definition at line 66 of file SDDSWriter.h.

◆ writeColumns()

void SDDSWriter::writeColumns ( )
private

Definition at line 191 of file SDDSWriter.cpp.

References columns_m, indent_m, os_m, and SDDSColumnSet::writeHeader().

Referenced by writeHeader().

Here is the call graph for this function:

◆ writeDescription()

void SDDSWriter::writeDescription ( )
private

Definition at line 167 of file SDDSWriter.cpp.

References desc_m, endl(), indent_m, and os_m.

Referenced by writeHeader().

Here is the call graph for this function:

◆ writeHeader()

void SDDSWriter::writeHeader ( )
protected

Write SDDS header.

Writes the appropriate SDDS format header information, The SDDS tools can be used for plotting data.

Definition at line 151 of file SDDSWriter.cpp.

References mode_m, IpplInfo::myNode(), writeColumns(), writeDescription(), writeInfo(), and writeParameters().

Referenced by MonitorStatisticsWriter::addRow(), ElementPositionWriter::addRow(), MemoryProfiler::write(), MemoryWriter::write(), MultiBunchDump::write(), StatWriter::write(), GridLBalWriter::write(), and LBalWriter::write().

Here is the call graph for this function:

◆ writeInfo()

void SDDSWriter::writeInfo ( )
private

Definition at line 196 of file SDDSWriter.cpp.

References endl(), indent_m, info_m, os_m, and paramValues_m.

Referenced by writeHeader().

Here is the call graph for this function:

◆ writeParameters()

void SDDSWriter::writeParameters ( )
private

Definition at line 176 of file SDDSWriter.cpp.

References indent_m, os_m, and params_m.

Referenced by writeHeader().

◆ writeRow()

void SDDSWriter::writeRow ( )
inlineprotected

Member Data Documentation

◆ columns_m

SDDSColumnSet SDDSWriter::columns_m
protected

◆ desc_m

desc_t SDDSWriter::desc_m
private

Definition at line 147 of file SDDSWriter.h.

Referenced by addDescription(), and writeDescription().

◆ fname_m

std::string SDDSWriter::fname_m
protected

◆ indent_m

std::string SDDSWriter::indent_m
private

Definition at line 145 of file SDDSWriter.h.

Referenced by writeColumns(), writeDescription(), writeInfo(), and writeParameters().

◆ info_m

data_t SDDSWriter::info_m
private

Definition at line 150 of file SDDSWriter.h.

Referenced by addInfo(), and writeInfo().

◆ mode_m

std::ios_base::openmode SDDSWriter::mode_m
protected

First write to the statistics output file.

Initially set to std::ios::out so that SDDS format header information is written to file during the first write call to the statistics output file. Variable is then reset to std::ios::app so that header information is only written once.

Definition at line 124 of file SDDSWriter.h.

Referenced by MemoryWriter::fillHeader(), MultiBunchDump::fillHeader(), StatWriter::fillHeader(), GridLBalWriter::fillHeader(), LBalWriter::fillHeader(), MemoryProfiler::header(), open(), SDDSWriter(), and writeHeader().

◆ os_m

std::ofstream SDDSWriter::os_m
private

◆ params_m

std::queue<param_t> SDDSWriter::params_m
private

Definition at line 148 of file SDDSWriter.h.

Referenced by addParameter(), and writeParameters().

◆ paramValues_m

std::queue<std::string> SDDSWriter::paramValues_m
private

Definition at line 149 of file SDDSWriter.h.

Referenced by addParameter(), and writeInfo().

◆ precision_m

constexpr unsigned int SDDSWriter::precision_m = 15
staticconstexprprivate

Definition at line 153 of file SDDSWriter.h.

Referenced by open(), and toString().


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