27#ifndef __SDDSVARIABLE_H__
28#define __SDDSVARIABLE_H__
32#include "boost/variant/get.hpp"
33#include "boost/variant/variant.hpp"
34#include "boost/smart_ptr.hpp"
44 static const std::string
name;
47 switch ( args.size() ) {
49 var_name_ = boost::get<std::string>(args[0]);
51 ref_val_ = boost::get<double>(args[1]);
56 var_name_ = boost::get<std::string>(args[0]);
57 ref_name_ = boost::get<std::string>(args[1]);
58 ref_val_ = boost::get<double>(args[2]);
64 "sddsVariableAt expects 3 or 4 arguments, " +
65 std::to_string(args.size()) +
" given");
73 sim_stats->parseFile();
79 double sim_value = 0.0;
83 std::cout <<
"Exception while getting value "
84 <<
"from SDDS file: " <<
e.what()
88 std::cout <<
"Exception while getting '" +
var_name_ +
"' "
94 return boost::make_tuple(sim_value, is_valid);
116 size_t pos = base_filename.find_last_of(
"/");
117 std::string tmplfile = base_filename;
118 if(pos != std::string::npos)
119 tmplfile = base_filename.substr(pos+1);
120 pos = tmplfile.find_last_of(
".");
126 if (args.size() < 2 || args.size() > 3) {
128 "statVariableAt expects 2 or 3 arguments, " +
129 std::to_string(args.size()) +
" given");
Inform & endl(Inform &inf)
boost::tuple< double, bool > Result_t
constexpr double e
The value of.
std::vector< argument_t > arguments_t
boost::variant< double, bool, std::string > argument_t
Expressions::Result_t operator()(client::function::arguments_t args)
std::string stat_filename_
static const std::string name
client::function::argument_t stat_filename_
sameSDDSVariable(const std::string &base_filename)
Expressions::Result_t operator()(client::function::arguments_t args)
virtual const char * what() const