OPALX (Object Oriented Parallel Accelerator Library for Exascale) MINIorX
OPALX
ElementPositionWriter Class Reference

#include <ElementPositionWriter.h>

Inheritance diagram for ElementPositionWriter:
Inheritance graph
Collaboration diagram for ElementPositionWriter:
Collaboration graph

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

 ElementPositionWriter (const std::string &fname)
 
void addRow (double spos, const std::vector< double > &row, const std::string &elements)
 
virtual void write (const PartBunch_t *)
 
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 fillHeader ()
 
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 6 of file ElementPositionWriter.h.

Member Typedef Documentation

◆ cols_t

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

Definition at line 50 of file SDDSWriter.h.

◆ data_t

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

Definition at line 47 of file SDDSWriter.h.

◆ desc_t

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

Definition at line 41 of file SDDSWriter.h.

◆ param_t

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

Definition at line 44 of file SDDSWriter.h.

Constructor & Destructor Documentation

◆ ElementPositionWriter()

ElementPositionWriter::ElementPositionWriter ( const std::string &  fname)
explicit

Definition at line 6 of file ElementPositionWriter.cpp.

Member Function Documentation

◆ addColumn()

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

◆ addDefaultParameters()

void SDDSWriter::addDefaultParameters ( )
protectedinherited

◆ addDescription()

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

◆ addInfo()

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

◆ addParameter()

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

Definition at line 147 of file SDDSWriter.h.

References SDDSWriter::params_m, and SDDSWriter::paramValues_m.

Referenced by SDDSWriter::addDefaultParameters().

◆ addRow()

void ElementPositionWriter::addRow ( double  spos,
const std::vector< double > &  row,
const std::string &  elements 
)

◆ close()

void SDDSWriter::close ( )
protectedinherited

◆ exists()

bool SDDSWriter::exists ( ) const
inlineinherited

Definition at line 138 of file SDDSWriter.h.

References SDDSWriter::fname_m.

◆ fillHeader()

void ElementPositionWriter::fillHeader ( )
private

◆ getLastValue()

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

Definition at line 120 of file SDDSWriter.cpp.

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

Here is the call graph for this function:

◆ hasColumns()

bool SDDSWriter::hasColumns ( ) const
inlineprotectedinherited

◆ open()

◆ replaceVersionString()

void SDDSWriter::replaceVersionString ( )
inherited

◆ rewindLines()

void SDDSWriter::rewindLines ( size_t  numberOfLines)
inherited

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

Definition at line 45 of file SDDSWriter.cpp.

References ippl::Comm, and SDDSWriter::fname_m.

◆ toString()

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

Definition at line 164 of file SDDSWriter.h.

References SDDSWriter::precision_m.

Referenced by MemoryProfiler::write().

◆ write()

virtual void SDDSWriter::write ( const PartBunch_t )
inlinevirtualinherited

Reimplemented in StatWriter, LBalWriter, and MemoryProfiler.

Definition at line 56 of file SDDSWriter.h.

◆ writeColumns()

void SDDSWriter::writeColumns ( )
privateinherited

Definition at line 180 of file SDDSWriter.cpp.

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

Referenced by SDDSWriter::writeHeader().

Here is the call graph for this function:

◆ writeDescription()

void SDDSWriter::writeDescription ( )
privateinherited

Definition at line 158 of file SDDSWriter.cpp.

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

Referenced by SDDSWriter::writeHeader().

Here is the call graph for this function:

◆ writeHeader()

void SDDSWriter::writeHeader ( )
protectedinherited

Write SDDS header.

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

Definition at line 143 of file SDDSWriter.cpp.

References ippl::Comm, SDDSWriter::mode_m, SDDSWriter::writeColumns(), SDDSWriter::writeDescription(), SDDSWriter::writeInfo(), and SDDSWriter::writeParameters().

Referenced by MonitorStatisticsWriter::addRow(), addRow(), LBalWriter::write(), MemoryProfiler::write(), and StatWriter::write().

Here is the call graph for this function:

◆ writeInfo()

void SDDSWriter::writeInfo ( )
privateinherited

Definition at line 184 of file SDDSWriter.cpp.

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

Referenced by SDDSWriter::writeHeader().

Here is the call graph for this function:

◆ writeParameters()

void SDDSWriter::writeParameters ( )
privateinherited

Definition at line 166 of file SDDSWriter.cpp.

References SDDSWriter::indent_m, SDDSWriter::os_m, and SDDSWriter::params_m.

Referenced by SDDSWriter::writeHeader().

◆ writeRow()

void SDDSWriter::writeRow ( )
inlineprotectedinherited

Definition at line 159 of file SDDSWriter.h.

References SDDSWriter::columns_m, SDDSWriter::os_m, and SDDSColumnSet::writeRow().

Referenced by MonitorStatisticsWriter::addRow(), addRow(), LBalWriter::write(), MemoryProfiler::write(), and StatWriter::write().

Here is the call graph for this function:

Member Data Documentation

◆ columns_m

◆ desc_m

desc_t SDDSWriter::desc_m
privateinherited

Definition at line 130 of file SDDSWriter.h.

Referenced by SDDSWriter::addDescription(), and SDDSWriter::writeDescription().

◆ fname_m

◆ indent_m

std::string SDDSWriter::indent_m
privateinherited

◆ info_m

data_t SDDSWriter::info_m
privateinherited

Definition at line 133 of file SDDSWriter.h.

Referenced by SDDSWriter::addInfo(), and SDDSWriter::writeInfo().

◆ mode_m

std::ios_base::openmode SDDSWriter::mode_m
protectedinherited

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 108 of file SDDSWriter.h.

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

◆ os_m

◆ params_m

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

Definition at line 131 of file SDDSWriter.h.

Referenced by SDDSWriter::addParameter(), and SDDSWriter::writeParameters().

◆ paramValues_m

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

Definition at line 132 of file SDDSWriter.h.

Referenced by SDDSWriter::addParameter(), and SDDSWriter::writeInfo().

◆ precision_m

constexpr unsigned int SDDSWriter::precision_m = 15
staticconstexprprivateinherited

Definition at line 135 of file SDDSWriter.h.

Referenced by SDDSWriter::open(), and SDDSWriter::toString().


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