19 #ifndef OPAL_SDDS_WRITER_H
20 #define OPAL_SDDS_WRITER_H
36 template <
class T,
unsigned Dim>
43 typedef std::pair<std::string, std::string>
desc_t;
46 typedef std::tuple<std::string,
51 typedef std::pair<std::string, size_t>
data_t;
54 typedef std::tuple<std::string,
59 SDDSWriter(
const std::string& fname,
bool restart);
78 const std::string& content);
82 const std::string&
type,
83 const std::string& desc,
89 const std::string&
type,
90 const std::string& unit,
91 const std::string& desc);
94 const size_t& no_row_counts);
154 return std::filesystem::exists(
fname_m);
160 const std::string& content) {
161 desc_m = std::make_pair(text, content);
167 const std::string&
type,
168 const std::string& desc,
170 params_m.push(std::make_tuple(name, type, desc));
171 std::stringstream ss;
179 const size_t& no_row_counts) {
180 info_m = std::make_pair(mode, no_row_counts);
192 std::ostringstream ss;
static constexpr unsigned int precision_m
void addDescription(const std::string &text, const std::string &content)
std::tuple< std::string, std::string, std::string, std::string > cols_t
void addParameter(const std::string &name, const std::string &type, const std::string &desc, const T &value)
SDDSWriter(const std::string &fname, bool restart)
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)
virtual void write(PartBunchBase< double, 3 > *)
std::tuple< std::string, std::string, std::string > param_t
std::queue< param_t > params_m
void addDefaultParameters()
if write to the Free Software Temple MA USA Also add information on how to contact you by electronic and paper mail If the program is make it output a short notice like this when it starts in an interactive mode
void addInfo(const std::string &mode, const size_t &no_row_counts)
std::queue< std::string > paramValues_m
std::string toString(const T &val)
void rewindLines(size_t numberOfLines)
delete the last 'numberOfLines' lines of the file 'fileName'
void writeHeader()
Write SDDS header.
void replaceVersionString()
std::pair< std::string, size_t > data_t
void writeRow(std::ostream &os) const
double getLastValue(const std::string &column)
std::ios_base::openmode mode_m
First write to the statistics output file.