25#include "neml2/base/OptionSet.h"
42 "ERROR: no option named \"",
44 "\" found.\n\nKnown options:\n",
54 "ERROR: no option named \"",
56 "\" found.\n\nKnown options:\n",
80 for (
const auto & [
key, value] :
source._values)
98 os <<
" " <<
doc() <<
'\n';
103 os <<
" " <<
it->first <<
":\n";
104 os <<
" type: " <<
it->second->type() <<
'\n';
105 if (
it->second->doc().empty())
110 os <<
" " <<
it->second->doc() <<
'\n';
112 os <<
" suppressed: " <<
it->second->suppressed() <<
'\n';
114 it->second->print(
os);
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
Definition OptionSet.h:126
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:59
map_type _values
Data structure to map names with values.
Definition OptionSet.h:374
const std::string & name() const
A readonly reference to the option set's name.
Definition OptionSet.h:79
const std::string & doc() const
A readonly reference to the option set's docstring.
Definition OptionSet.h:91
map_type::const_iterator const_iterator
Constant option map iterator.
Definition OptionSet.h:284
const std::string & section() const
A readonly reference to the option set's section.
Definition OptionSet.h:95
iterator begin()
Iterator pointing to the beginning of the set of options.
Definition OptionSet.cxx:129
iterator end()
Iterator pointing to the end of the set of options.
Definition OptionSet.cxx:141
virtual void operator+=(const OptionSet &source)
Definition OptionSet.cxx:78
const T & get(const std::string &) const
Definition OptionSet.h:422
struct neml2::OptionSet::Metadata _metadata
virtual void clear()
Clear internal data structures & frees any allocated memory.
Definition OptionSet.cxx:63
T & set(const std::string &)
Definition OptionSet.h:436
void print(std::ostream &os=std::cout) const
Print the contents.
Definition OptionSet.cxx:88
virtual OptionSet & operator=(const OptionSet &source)
Assignment operator. Deep copy.
Definition OptionSet.cxx:69
bool contains(const std::string &) const
Definition OptionSet.h:411
map_type::iterator iterator
Option map iterator.
Definition OptionSet.h:281
Definition CrossRef.cxx:32
std::ostream & operator<<(std::ostream &os, const OptionCollection &p)
Definition OptionCollection.cxx:37
void neml_assert(bool assertion, Args &&... args)
Definition error.h:73