19 #ifndef OPAL_SDDS_WRITER_H
20 #define OPAL_SDDS_WRITER_H
33 #include <boost/filesystem.hpp>
38 template <
class T,
unsigned Dim>
45 typedef std::pair<std::string, std::string>
desc_t;
48 typedef std::tuple<std::string,
53 typedef std::pair<std::string, size_t>
data_t;
56 typedef std::tuple<std::string,
62 SDDSWriter(
const std::string& fname,
bool restart);
82 const std::string& content);
86 const std::string&
type,
87 const std::string& desc,
93 const std::string&
type,
94 const std::string& unit,
95 const std::string& desc);
97 void addInfo(
const std::string& mode,
98 const size_t& no_row_counts);
159 return boost::filesystem::exists(
fname_m);
165 const std::string& content)
167 desc_m = std::make_pair(text, content);
173 const std::string&
type,
174 const std::string& desc,
178 std::stringstream ss;
186 const size_t& no_row_counts) {
187 info_m = std::make_pair(mode, no_row_counts);
199 std::ostringstream ss;
boost::function< boost::tuple< double, bool >arguments_t)> type
void writeRow(std::ostream &os) const
void replaceVersionString()
SDDSWriter(const std::string &fname, bool restart)
std::tuple< std::string, std::string, std::string, std::string > cols_t
void rewindLines(size_t numberOfLines)
delete the last 'numberOfLines' lines of the file 'fileName'
std::string toString(const T &val)
static constexpr unsigned int precision_m
double getLastValue(const std::string &column)
void addDefaultParameters()
void addDescription(const std::string &text, const std::string &content)
std::queue< std::string > paramValues_m
void writeHeader()
Write SDDS header.
std::ios_base::openmode mode_m
First write to the statistics output file.
virtual void write(const PartBunchBase< double, 3 > *)
std::tuple< std::string, std::string, std::string > param_t
void addInfo(const std::string &mode, const size_t &no_row_counts)
std::queue< param_t > params_m
std::pair< std::string, size_t > data_t
void addParameter(const std::string &name, const std::string &type, const std::string &desc, const T &value)
std::pair< std::string, std::string > desc_t
void addColumn(const std::string &name, const std::string &type, const std::string &unit, const std::string &desc)