|
BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Stores multi option (int,double,string) in a container. More...
Public Types | |
| using | const_iterator = container_t::const_iterator |
| using | container_t = std::vector< option_t > |
| using | iterator = container_t::iterator |
| using | option_t = std::shared_ptr< MultiOption > |
Public Member Functions | |
| OptionContainer () | |
| OptionContainer (const OptionContainer &other) | |
| Returns true if option with such name already exists. More... | |
| template<class T > | |
| option_t | addOption (const std::string &optionName, T value, const std::string &description="") |
| iterator | begin () |
| const_iterator | begin () const |
| bool | empty () const |
| iterator | end () |
| const_iterator | end () const |
| OptionContainer & | operator= (const OptionContainer &other) |
| option_t | option (const std::string &optionName) |
| const option_t | option (const std::string &optionName) const |
| template<class T > | |
| T | optionValue (const std::string &optionName) const |
| template<class T > | |
| void | setOptionValue (const std::string &optionName, T value) |
| Sets the value of option. Option should hold same value type already. More... | |
| size_t | size () const |
Protected Member Functions | |
| bool | exists (const std::string &name) |
| void | swapContent (OptionContainer &other) |
Protected Attributes | |
| container_t | m_options |
Stores multi option (int,double,string) in a container.
Definition at line 32 of file OptionContainer.h.
| using OptionContainer::const_iterator = container_t::const_iterator |
Definition at line 37 of file OptionContainer.h.
| using OptionContainer::container_t = std::vector<option_t> |
Definition at line 35 of file OptionContainer.h.
| using OptionContainer::iterator = container_t::iterator |
Definition at line 36 of file OptionContainer.h.
| using OptionContainer::option_t = std::shared_ptr<MultiOption> |
Definition at line 34 of file OptionContainer.h.
|
inline |
Definition at line 39 of file OptionContainer.h.
| OptionContainer::OptionContainer | ( | const OptionContainer & | other | ) |
Returns true if option with such name already exists.
Definition at line 19 of file OptionContainer.cpp.
References m_options, and option().
| OptionContainer::option_t OptionContainer::addOption | ( | const std::string & | optionName, |
| T | value, | ||
| const std::string & | description = "" |
||
| ) |
Definition at line 70 of file OptionContainer.h.
References exists(), and m_options.
Referenced by MinimizerAdapter::addOption().
|
inline |
|
inline |
|
inline |
Definition at line 61 of file OptionContainer.h.
References size().
|
inline |
|
inline |
|
protected |
Definition at line 56 of file OptionContainer.cpp.
References m_options, RealSpace::Particles::name(), and option().
Referenced by addOption().
| OptionContainer & OptionContainer::operator= | ( | const OptionContainer & | other | ) |
Definition at line 25 of file OptionContainer.cpp.
References swapContent().
| OptionContainer::option_t OptionContainer::option | ( | const std::string & | optionName | ) |
Definition at line 34 of file OptionContainer.cpp.
References m_options.
Referenced by OptionContainer(), exists(), option(), optionValue(), MinimizerOptions::processCommand(), setOptionValue(), and MinimizerOptions::toOptionString().
| const OptionContainer::option_t OptionContainer::option | ( | const std::string & | optionName | ) | const |
Definition at line 45 of file OptionContainer.cpp.
References m_options, and option().
| T OptionContainer::optionValue | ( | const std::string & | optionName | ) | const |
Definition at line 82 of file OptionContainer.h.
References option().
Referenced by MinimizerAdapter::optionValue().
| void OptionContainer::setOptionValue | ( | const std::string & | optionName, |
| T | value | ||
| ) |
Sets the value of option. Option should hold same value type already.
Definition at line 87 of file OptionContainer.h.
References option().
Referenced by MinimizerAdapter::setOptionValue().
|
inline |
|
protected |
Definition at line 65 of file OptionContainer.cpp.
References m_options, and swap().
Referenced by operator=().
|
protected |
Definition at line 66 of file OptionContainer.h.
Referenced by OptionContainer(), addOption(), begin(), end(), exists(), option(), size(), swapContent(), and MinimizerOptions::toOptionString().