OPAL (Object Oriented Parallel Accelerator Library)
2.2.0
OPAL
|
#include <SDDSWriter.h>
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 (PartBunchBase< double, 3 > *beam) |
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_t > | params_m |
std::queue< std::string > | paramValues_m |
data_t | info_m |
Static Private Attributes | |
static constexpr unsigned int | precision_m = 15 |
Definition at line 24 of file SDDSWriter.h.
typedef std::tuple<std::string, std::string, std::string, std::string> SDDSWriter::cols_t |
Definition at line 42 of file SDDSWriter.h.
typedef std::pair<std::string, size_t> SDDSWriter::data_t |
Definition at line 36 of file SDDSWriter.h.
typedef std::pair<std::string, std::string> SDDSWriter::desc_t |
Definition at line 28 of file SDDSWriter.h.
typedef std::tuple<std::string, std::string, std::string> SDDSWriter::param_t |
Definition at line 33 of file SDDSWriter.h.
SDDSWriter::SDDSWriter | ( | const std::string & | fname, |
bool | restart | ||
) |
Definition at line 11 of file SDDSWriter.cpp.
References endl(), fname_m, Hypervolume::fs, INFOMSG, and mode_m.
|
inlinevirtual |
Definition at line 47 of file SDDSWriter.h.
|
protected |
|
protected |
Definition at line 190 of file SDDSWriter.cpp.
References addParameter(), Util::getGitRevision(), OpalData::getInstance(), IpplInfo::getNodes(), OPAL_PROJECT_NAME, and OPAL_PROJECT_VERSION.
Referenced by GridLBalWriter::fillHeader(), MemoryWriter::fillHeader(), LBalWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), ElementPositionWriter::fillHeader(), MultiBunchDump::fillHeader(), StatWriter::fillHeader(), and MemoryProfiler::header().
|
inlineprotected |
Definition at line 147 of file SDDSWriter.h.
References desc_m.
Referenced by GridLBalWriter::fillHeader(), MemoryWriter::fillHeader(), LBalWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), ElementPositionWriter::fillHeader(), MultiBunchDump::fillHeader(), StatWriter::fillHeader(), and MemoryProfiler::header().
|
inlineprotected |
Definition at line 168 of file SDDSWriter.h.
References info_m.
Referenced by GridLBalWriter::fillHeader(), MemoryWriter::fillHeader(), LBalWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), ElementPositionWriter::fillHeader(), MultiBunchDump::fillHeader(), StatWriter::fillHeader(), and MemoryProfiler::header().
|
protected |
Definition at line 155 of file SDDSWriter.h.
References params_m, and paramValues_m.
Referenced by addDefaultParameters().
|
protected |
Definition at line 123 of file SDDSWriter.cpp.
References IpplInfo::myNode(), and os_m.
Referenced by ElementPositionWriter::addRow(), MonitorStatisticsWriter::addRow(), GridLBalWriter::write(), MemoryWriter::write(), LBalWriter::write(), MultiBunchDump::write(), StatWriter::write(), and MemoryProfiler::write().
|
inline |
Definition at line 141 of file SDDSWriter.h.
References fname_m.
double SDDSWriter::getLastValue | ( | const std::string & | column | ) |
Definition at line 104 of file SDDSWriter.cpp.
References fname_m, SDDS::SDDSParser::getValue(), and SDDS::SDDSParser::run().
|
inlineprotected |
Definition at line 190 of file SDDSWriter.h.
References columns_m, and SDDSColumnSet::hasColumns().
Referenced by GridLBalWriter::fillHeader(), MemoryWriter::fillHeader(), LBalWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), ElementPositionWriter::fillHeader(), MultiBunchDump::fillHeader(), StatWriter::fillHeader(), and MemoryProfiler::header().
|
protected |
Definition at line 113 of file SDDSWriter.cpp.
References fname_m, mode_m, IpplInfo::myNode(), os_m, and precision_m.
Referenced by ElementPositionWriter::addRow(), MonitorStatisticsWriter::addRow(), GridLBalWriter::write(), MemoryWriter::write(), LBalWriter::write(), MultiBunchDump::write(), StatWriter::write(), and MemoryProfiler::write().
void SDDSWriter::replaceVersionString | ( | ) |
Definition at line 58 of file SDDSWriter.cpp.
References fname_m, Hypervolume::fs, Util::getGitRevision(), SDDS::SDDSParser::getParameterValue(), IpplInfo::myNode(), OPAL_PROJECT_NAME, OPAL_PROJECT_VERSION, and SDDS::SDDSParser::run().
void SDDSWriter::rewindLines | ( | size_t | numberOfLines | ) |
delete the last 'numberOfLines' lines of the file 'fileName'
Definition at line 27 of file SDDSWriter.cpp.
References fname_m, Hypervolume::fs, and IpplInfo::myNode().
|
protected |
Definition at line 181 of file SDDSWriter.h.
References precision_m.
Referenced by GridLBalWriter::write(), and MemoryProfiler::write().
|
inlinevirtual |
Reimplemented in MemoryProfiler, GridLBalWriter, LBalWriter, and MemoryWriter.
Definition at line 49 of file SDDSWriter.h.
|
private |
Definition at line 170 of file SDDSWriter.cpp.
References columns_m, indent_m, os_m, and SDDSColumnSet::writeHeader().
Referenced by writeHeader().
|
private |
Definition at line 146 of file SDDSWriter.cpp.
References desc_m, endl(), indent_m, and os_m.
Referenced by writeHeader().
|
protected |
Write SDDS header.
Writes the appropriate SDDS format header information, The SDDS tools can be used for plotting data.
Definition at line 130 of file SDDSWriter.cpp.
References mode_m, IpplInfo::myNode(), writeColumns(), writeDescription(), writeInfo(), and writeParameters().
Referenced by ElementPositionWriter::addRow(), MonitorStatisticsWriter::addRow(), GridLBalWriter::write(), MemoryWriter::write(), LBalWriter::write(), MultiBunchDump::write(), StatWriter::write(), and MemoryProfiler::write().
|
private |
Definition at line 175 of file SDDSWriter.cpp.
References endl(), indent_m, info_m, os_m, and paramValues_m.
Referenced by writeHeader().
|
private |
Definition at line 155 of file SDDSWriter.cpp.
References indent_m, os_m, and params_m.
Referenced by writeHeader().
|
inlineprotected |
Definition at line 175 of file SDDSWriter.h.
References columns_m, os_m, and SDDSColumnSet::writeRow().
Referenced by ElementPositionWriter::addRow(), MonitorStatisticsWriter::addRow(), GridLBalWriter::write(), MemoryWriter::write(), LBalWriter::write(), MultiBunchDump::write(), StatWriter::write(), and MemoryProfiler::write().
|
protected |
Definition at line 109 of file SDDSWriter.h.
Referenced by ElementPositionWriter::addRow(), MonitorStatisticsWriter::addRow(), LBalWriter::fillHeader(), MemoryWriter::fillHeader(), GridLBalWriter::fillHeader(), ElementPositionWriter::fillHeader(), MonitorStatisticsWriter::fillHeader(), MultiBunchDump::fillHeader(), StatWriter::fillHeader(), hasColumns(), MemoryProfiler::header(), GridLBalWriter::write(), MemoryWriter::write(), LBalWriter::write(), MultiBunchDump::write(), StatWriter::write(), MemoryProfiler::write(), writeColumns(), and writeRow().
|
private |
Definition at line 130 of file SDDSWriter.h.
Referenced by addDescription(), and writeDescription().
|
protected |
Definition at line 99 of file SDDSWriter.h.
Referenced by exists(), getLastValue(), open(), replaceVersionString(), rewindLines(), StatBaseWriter::rewindToSpos(), and SDDSWriter().
|
private |
Definition at line 128 of file SDDSWriter.h.
Referenced by writeColumns(), writeDescription(), writeInfo(), and writeParameters().
|
private |
Definition at line 133 of file SDDSWriter.h.
Referenced by addInfo(), and writeInfo().
|
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 107 of file SDDSWriter.h.
Referenced by GridLBalWriter::fillHeader(), LBalWriter::fillHeader(), MemoryWriter::fillHeader(), MultiBunchDump::fillHeader(), StatWriter::fillHeader(), MemoryProfiler::header(), open(), SDDSWriter(), and writeHeader().
|
private |
Definition at line 126 of file SDDSWriter.h.
Referenced by close(), open(), writeColumns(), writeDescription(), writeInfo(), writeParameters(), and writeRow().
|
private |
Definition at line 131 of file SDDSWriter.h.
Referenced by addParameter(), and writeParameters().
|
private |
Definition at line 132 of file SDDSWriter.h.
Referenced by addParameter(), and writeInfo().
|
staticprivate |
Definition at line 136 of file SDDSWriter.h.
Referenced by open(), and toString().