27#include "neml2/base/EnumSelectionBase.h"
33std::ostream &
operator<<(std::ostream &,
const EnumSelection &);
34std::stringstream &
operator>>(std::stringstream &, EnumSelection &);
50 const std::vector<int> &
values,
69 operator std::string()
const {
return _selection; }
72 operator int()
const {
return _value; }
78 return static_cast<T
>(_value);
83 std::string _selection =
"";
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:54
Definition EnumSelectionBase.h:44
const std::unordered_map< std::string, int > & candidates() const
Candidates.
Definition EnumSelectionBase.h:55
Selection of an enum value from a list of candidates.
Definition EnumSelection.h:41
T as() const
Statically cast the enum value to a C++ enum class.
Definition EnumSelection.h:76
void select(const std::string &selection)
Select a new value.
Definition EnumSelection.cxx:85
bool operator!=(const EnumSelection &other) const
Test for inequality.
Definition EnumSelection.cxx:67
bool operator==(const EnumSelection &other) const
Test for equality.
Definition EnumSelection.cxx:60
Definition CrossRef.cxx:31
std::ostream & operator<<(std::ostream &os, const EnumSelection &es)
Definition EnumSelection.cxx:31
std::stringstream & operator>>(std::stringstream &ss, EnumSelection &es)
Definition EnumSelection.cxx:38