1 #ifndef __SDDSVARIABLE_H__
2 #define __SDDSVARIABLE_H__
6 #include "boost/variant/get.hpp"
7 #include "boost/variant/variant.hpp"
8 #include "boost/smart_ptr.hpp"
26 static const std::string
name;
29 switch ( args.size() ) {
31 var_name_ = boost::get<std::string>(args[0]);
33 ref_val_ = boost::get<double>(args[1]);
38 var_name_ = boost::get<std::string>(args[0]);
39 ref_name_ = boost::get<std::string>(args[1]);
40 ref_val_ = boost::get<double>(args[2]);
46 "sddsVariableAt expects 3 or 4 arguments, " +
47 std::to_string(args.size()) +
" given");
55 sim_stats->parseFile();
61 double sim_value = 0.0;
65 std::cout <<
"Exception while getting value "
66 <<
"from SDDS file: " << e.
what()
70 std::cout <<
"Exception while getting '" +
var_name_ +
"' "
76 return boost::make_tuple(sim_value, is_valid);
98 size_t pos = base_filename.find_last_of(
"/");
99 std::string tmplfile = base_filename;
100 if(pos != std::string::npos)
101 tmplfile = base_filename.substr(pos+1);
102 pos = tmplfile.find_last_of(
".");
108 if (args.size() < 2 || args.size() > 3) {
110 "statVariableAt expects 2 or 3 arguments, " +
111 std::to_string(args.size()) +
" given");
boost::variant< double, bool, std::string > argument_t
Expressions::Result_t operator()(client::function::arguments_t args)
constexpr double e
The value of .
std::string stat_filename_
boost::tuple< double, bool > Result_t
sameSDDSVariable(const std::string &base_filename)
std::vector< argument_t > arguments_t
Implements a parser and value extractor for Probe loss files.
client::function::argument_t stat_filename_
virtual const char * what() const
static const std::string name
Expressions::Result_t operator()(client::function::arguments_t args)
Inform & endl(Inform &inf)