16 #error no need to expose this header to Swig
20 #ifndef BORNAGAIN_FIT_TOOLS_OPTIONCONTAINER_H
21 #define BORNAGAIN_FIT_TOOLS_OPTIONCONTAINER_H
43 option_t addOption(
const std::string& optionName, T value,
const std::string& description =
"");
65 bool exists(
const std::string& name);
72 const std::string& description)
75 throw std::runtime_error(
"OptionContainer::addOption() -> Error. Option '" + optionName
86 return option(optionName)->get<T>();
92 option(optionName)->value() = value;
93 if (
option(optionName)->value().index() !=
option(optionName)->defaultValue().index())
94 throw std::runtime_error(
95 "OptionContainer::setOptionValue() -> Error. Attempt to set different"
Declares class MultiOption.
Stores a single option for minimization algorithm. Int, double, string values are available.
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
OptionContainer()=default
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)