16 #error no need to expose this header to Swig
20 #ifndef BORNAGAIN_FIT_TOOLS_OPTIONCONTAINER_H
21 #define BORNAGAIN_FIT_TOOLS_OPTIONCONTAINER_H
44 option_t addOption(
const std::string& optionName, T value,
const std::string& description =
"");
49 template <
class T> T
optionValue(
const std::string& optionName)
const;
52 template <
class T>
void setOptionValue(
const std::string& optionName, T value);
71 const std::string& description)
74 throw std::runtime_error(
"OptionContainer::addOption() -> Error. Option '" + optionName
84 return option(optionName)->get<T>();
89 option(optionName)->value() = value;
90 if (
option(optionName)->value().which() !=
option(optionName)->defaultValue().which())
91 throw std::runtime_error(
92 "OptionContainer::setOptionValue() -> Error. Attempt to set different"
Declares class MultiOption.
Stores a single option for minimization algorithm.
Stores multi option (int,double,string) in a container.
std::vector< option_t > container_t
const_iterator begin() const
void setOptionValue(const std::string &optionName, T value)
Sets the value of option. Option should hold same value type already.
const_iterator end() const
container_t::iterator iterator
T optionValue(const std::string &optionName) const
std::shared_ptr< MultiOption > option_t
OptionContainer & operator=(const OptionContainer &other)
option_t option(const std::string &optionName)
void swapContent(OptionContainer &other)
option_t addOption(const std::string &optionName, T value, const std::string &description="")
container_t::const_iterator const_iterator
bool exists(const std::string &name)
QString const & name(EShape k)