27 #ifndef __SDDSVARIABLE_H__
28 #define __SDDSVARIABLE_H__
32 #include "boost/variant/get.hpp"
33 #include "boost/variant/variant.hpp"
43 static const std::string
name;
46 switch ( args.size() ) {
48 var_name_ = boost::get<std::string>(args[0]);
50 ref_val_ = boost::get<double>(args[1]);
55 var_name_ = boost::get<std::string>(args[0]);
56 ref_name_ = boost::get<std::string>(args[1]);
57 ref_val_ = boost::get<double>(args[2]);
63 "sddsVariableAt expects 3 or 4 arguments, " +
64 std::to_string(args.size()) +
" given");
72 sim_stats->parseFile();
78 double sim_value = 0.0;
82 std::cout <<
"Exception while getting value "
83 <<
"from SDDS file: " << e.
what()
87 std::cout <<
"Exception while getting '" +
var_name_ +
"' "
93 return boost::make_tuple(sim_value, is_valid);
115 size_t pos = base_filename.find_last_of(
"/");
116 std::string tmplfile = base_filename;
117 if(pos != std::string::npos)
118 tmplfile = base_filename.substr(pos+1);
119 pos = tmplfile.find_last_of(
".");
125 if (args.size() < 2 || args.size() > 3) {
127 "statVariableAt expects 2 or 3 arguments, " +
128 std::to_string(args.size()) +
" given");
boost::variant< double, bool, std::string > argument_t
sameSDDSVariable(const std::string &base_filename)
static const std::string name
std::vector< argument_t > arguments_t
client::function::argument_t stat_filename_
Inform & endl(Inform &inf)
Expressions::Result_t operator()(client::function::arguments_t args)
std::string stat_filename_
constexpr double e
The value of .
Expressions::Result_t operator()(client::function::arguments_t args)
boost::tuple< double, bool > Result_t
virtual const char * what() const