|
NEML2 2.0.0
|
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed. More...
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
#include <OptionSet.h>
Classes | |
| struct | Metadata |
Public Member Functions | |
| OptionSet ()=default | |
| OptionSet (const OptionSet &) | |
| OptionSet (OptionSet &&) noexcept | |
| OptionSet & | operator= (const OptionSet &) |
| OptionSet & | operator= (OptionSet &&) noexcept |
| virtual | ~OptionSet ()=default |
| const std::string & | name () const |
| A readonly reference to the option set's name. | |
| std::string & | name () |
| A writable reference to the option set's name. | |
| const std::string & | type () const |
| A readonly reference to the option set's type. | |
| std::string & | type () |
| A writable reference to the option set's type. | |
| const std::string & | path () const |
| A readonly reference to the option set's path. | |
| std::string & | path () |
| A writable reference to the option set's path. | |
| const std::string & | doc () const |
| A readonly reference to the option set's docstring. | |
| std::string & | doc () |
| A writable reference to the option set's docstring. | |
| const std::string & | section () const |
| A readonly reference to the option set's section. | |
| std::string & | section () |
| A writable reference to the option set's section. | |
| bool | contains (const std::string &) const |
| bool | user_specified (const std::string &name) const |
| std::size_t | size () const |
| void | clear () |
| Clear internal data structures & frees any allocated memory. | |
| std::string | to_str () const |
| Print the contents. | |
| template<typename T > | |
| T | get (const std::string &) const |
| const OptionBase & | get (const std::string &) const |
| Get a const reference to the specified option value. | |
| void | operator+= (const OptionSet &source) |
| void | operator+= (OptionSet &&source) |
| template<typename T , FType f = FType::NONE> | |
| T & | set (const std::string &) |
| OptionBase & | set (const std::string &) |
Convenient methods to request an input variable | |
| LabeledAxisAccessor & | set_input (const std::string &) |
Convenient methods to request an output variable | |
| using | map_type = std::map<std::string, std::unique_ptr<OptionBase>, std::less<>> |
| The type of the map that we store internally. | |
| using | iterator = map_type::iterator |
| Option map iterator. | |
| using | const_iterator = map_type::const_iterator |
| Constant option map iterator. | |
| struct neml2::OptionSet::Metadata | _metadata |
| map_type | _values |
| Data structure to map names with values. | |
| LabeledAxisAccessor & | set_output (const std::string &) |
| template<typename T > | |
| T & | set_parameter (const std::string &) |
| Convenient method to request a parameter. | |
| template<typename T > | |
| T & | set_buffer (const std::string &) |
| Convenient method to request a buffer. | |
| iterator | begin () |
| Iterator pointing to the beginning of the set of options. | |
| const_iterator | begin () const |
| Iterator pointing to the beginning of the set of options. | |
| iterator | end () |
| Iterator pointing to the end of the set of options. | |
| const_iterator | end () const |
| Iterator pointing to the end of the set of options. | |
| using const_iterator = map_type::const_iterator |
Constant option map iterator.
| using map_type = std::map<std::string, std::unique_ptr<OptionBase>, std::less<>> |
The type of the map that we store internally.
|
default |
|
virtualdefault |
| OptionSet::iterator begin | ( | ) |
Iterator pointing to the beginning of the set of options.
| OptionSet::const_iterator begin | ( | ) | const |
Iterator pointing to the beginning of the set of options.
| void clear | ( | ) |
Clear internal data structures & frees any allocated memory.
| bool contains | ( | const std::string & | name | ) | const |
true if an option with a specified name exists, false otherwise.
|
inline |
A writable reference to the option set's docstring.
|
inline |
A readonly reference to the option set's docstring.
| OptionSet::iterator end | ( | ) |
Iterator pointing to the end of the set of options.
| OptionSet::const_iterator end | ( | ) | const |
Iterator pointing to the end of the set of options.
| T get | ( | const std::string & | name | ) | const |
| const OptionBase & get | ( | const std::string & | name | ) | const |
Get a const reference to the specified option value.
|
inline |
A writable reference to the option set's name.
|
inline |
A readonly reference to the option set's name.
| void operator+= | ( | const OptionSet & | source | ) |
Addition/Assignment operator. Inserts copies of all options from source. Any options of the same name already in this are replaced.
| void operator+= | ( | OptionSet && | source | ) |
|
inline |
A writable reference to the option set's path.
|
inline |
A readonly reference to the option set's path.
|
inline |
A writable reference to the option set's section.
|
inline |
A readonly reference to the option set's section.
| T & set | ( | const std::string & | name | ) |
get() member. | OptionBase & set | ( | const std::string & | name | ) |
| T & set_buffer | ( | const std::string & | name | ) |
Convenient method to request a buffer.
| LabeledAxisAccessor & set_input | ( | const std::string & | name | ) |
| LabeledAxisAccessor & set_output | ( | const std::string & | name | ) |
| T & set_parameter | ( | const std::string & | name | ) |
Convenient method to request a parameter.
|
inline |
| std::string to_str | ( | ) | const |
Print the contents.
|
inline |
A writable reference to the option set's type.
|
inline |
A readonly reference to the option set's type.
| bool user_specified | ( | const std::string & | name | ) | const |
true if an option is specified by the user (i.e., from the input file), false otherwise.
|
protected |