|
BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Stores a single option for minimization algorithm. More...
Public Types | |
| using | variant_t = boost::variant< int, double, std::string > |
Public Member Functions | |
| MultiOption (const std::string &name="") | |
| template<typename T > | |
| MultiOption (const std::string &name, const T &t, const std::string &descripion="") | |
| std::string | name () const |
| std::string | description () const |
| void | setDescription (const std::string &description) |
| variant_t & | value () |
| variant_t & | defaultValue () |
| template<typename T > | |
| T | get () const |
| Returns the option's value. | |
| template<typename T > | |
| T | getDefault () const |
| Returns the option's default value (i.e. used during construction) | |
| void | setFromString (const std::string &value) |
| Sets the value of option from string. More... | |
Stores a single option for minimization algorithm.
Int, double, string values are available. Relies on boost::variant, will be switched to std::variant in C++-17.
Definition at line 25 of file MultiOption.h.
| void MultiOption::setFromString | ( | const std::string & | value | ) |
Sets the value of option from string.
TODO find more elegant way (without if/else and boost::lexical_cast
Definition at line 48 of file MultiOption.cpp.