|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
|
#include <SDDSParser.h>
Public Member Functions | |
| SDDSParser () | |
| SDDSParser (const std::string &input) | |
| void | setInput (const std::string &input) |
| file | run () |
| file | getData () |
| ast::columnData_t | getColumnData (const std::string &columnName) |
| ast::datatype | getColumnType (const std::string &col_name) |
| template<typename T> | |
| void | getValue (int t, std::string column_name, T &nval) |
| template<typename T> | |
| void | getInterpolatedValue (std::string ref_name, double ref_val, std::string col_name, T &nval) |
| template<typename T> | |
| void | getInterpolatedValue (double spos, std::string col_name, T &nval) |
| template<typename T> | |
| void | getParameterValue (std::string parameter_name, T &nval) |
| template<typename T> | |
| T | getBoostVariantValue (const ast::variant_t &val, int datatype) const |
| Convert value from boost variant (only numeric types) to a value of type T. | |
Private Member Functions | |
| std::string | readFile () |
| int | getColumnIndex (std::string col_name) const |
Static Private Member Functions | |
| static void | fixCaseSensitivity (std::string &for_string) |
| static std::string | fixCaseSensitivity (const std::string &for_string) |
Private Attributes | |
| std::string | sddsFileName_m |
| std::map< std::string, int > | paramNameToID_m |
| mapping from parameter name to offset in params_m | |
| std::map< std::string, int > | columnNameToID_m |
| mapping from column name to ID in columns_m | |
| SDDS::file | sddsData_m |
Definition at line 45 of file SDDSParser.h.
| SDDS::SDDSParser::SDDSParser | ( | ) |
Definition at line 22 of file SDDSParser.cpp.
References sddsFileName_m.
| SDDS::SDDSParser::SDDSParser | ( | const std::string & | input | ) |
Definition at line 26 of file SDDSParser.cpp.
References sddsFileName_m.
|
inlinestaticprivate |
Definition at line 49 of file SDDSParser.h.
References fixCaseSensitivity().
|
staticprivate |
Definition at line 136 of file SDDSParser.cpp.
Referenced by fixCaseSensitivity(), getColumnIndex(), getParameterValue(), getValue(), and run().
|
inline |
Convert value from boost variant (only numeric types) to a value of type T.
Definition at line 204 of file SDDSParser.h.
References SDDS::ast::DOUBLE, SDDS::ast::FLOAT, SDDS::ast::LONG, and SDDS::ast::SHORT.
Referenced by getInterpolatedValue(), and getValue().
| SDDS::ast::columnData_t SDDS::SDDSParser::getColumnData | ( | const std::string & | columnName | ) |
Definition at line 116 of file SDDSParser.cpp.
References getColumnIndex(), and sddsData_m.
|
private |
Definition at line 123 of file SDDSParser.cpp.
References columnNameToID_m, and fixCaseSensitivity().
Referenced by getColumnData(), getColumnType(), getInterpolatedValue(), and getValue().
|
inline |
Definition at line 72 of file SDDSParser.h.
References getColumnIndex(), and sddsData_m.
Referenced by getInterpolatedValue(), and getValue().
|
inline |
Definition at line 238 of file SDDSParser.h.
References sddsData_m.
|
inline |
Converts the string value of a parameter at a position spos to a value of type T.
| spos | interpolate value at spos |
| col_name | parameter name |
| nval | store result of type T in nval |
Definition at line 175 of file SDDSParser.h.
References getInterpolatedValue().
|
inline |
Converts the string value of a parameter to a value of type T.
| ref_name | reference quantity (e.g. spos) |
| ref_val | interpolate value of reference quantity (e.g. spos) |
| col_name | parameter name |
| nval | store result of type T in nval |
Definition at line 115 of file SDDSParser.h.
References getBoostVariantValue(), getColumnIndex(), getColumnType(), and sddsData_m.
Referenced by getInterpolatedValue().
|
inline |
Converts the string value of a parameter to a value of type T.
| parameter_name | parameter name |
| nval | store result of type T in nval |
Definition at line 187 of file SDDSParser.h.
References fixCaseSensitivity(), paramNameToID_m, and sddsData_m.
Referenced by SDDSWriter::replaceVersionString().
|
inline |
Converts the string value of a parameter at timestep t to a value of type T.
| t | timestep (beginning at 1, -1 means last) |
| column_name | parameter name |
| nval | store result of type T in nval |
Definition at line 86 of file SDDSParser.h.
References fixCaseSensitivity(), getBoostVariantValue(), getColumnIndex(), getColumnType(), and sddsData_m.
Referenced by SDDSWriter::getLastValue().
|
private |
Definition at line 94 of file SDDSParser.cpp.
References sddsFileName_m.
Referenced by run().
| SDDS::file SDDS::SDDSParser::run | ( | ) |
Definition at line 34 of file SDDSParser.cpp.
References columnNameToID_m, fixCaseSensitivity(), SDDS::column::name_m, SDDS::parameter::name_m, paramNameToID_m, readFile(), and sddsData_m.
Referenced by SDDSWriter::getLastValue(), and SDDSWriter::replaceVersionString().
| void SDDS::SDDSParser::setInput | ( | const std::string & | input | ) |
Definition at line 30 of file SDDSParser.cpp.
References sddsFileName_m.
|
private |
mapping from column name to ID in columns_m
Definition at line 59 of file SDDSParser.h.
Referenced by getColumnIndex(), and run().
|
private |
mapping from parameter name to offset in params_m
Definition at line 57 of file SDDSParser.h.
Referenced by getParameterValue(), and run().
|
private |
Definition at line 61 of file SDDSParser.h.
Referenced by getColumnData(), getColumnType(), getData(), getInterpolatedValue(), getParameterValue(), getValue(), and run().
|
private |
Definition at line 54 of file SDDSParser.h.
Referenced by readFile(), SDDSParser(), SDDSParser(), and setInput().