27#include "neml2/misc/error.h"
31#include <unordered_map>
38std::ostream &
operator<<(std::ostream &,
const EnumSelection &);
39std::stringstream &
operator>>(std::stringstream &, EnumSelection &);
55 const std::vector<int> &
values,
74 operator std::string()
const {
return _selection; }
77 operator int()
const {
return _value; }
80 const std::unordered_map<std::string, int> &
candidates()
const {
return _values; }
89 return static_cast<T
>(_value);
94 std::unordered_map<std::string, int> _values;
97 std::string _selection;
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:56
Definition EnumSelection.h:49
T as() const
Statically cast the enum value to a C++ enum class.
Definition EnumSelection.h:87
EnumSelection & operator=(const EnumSelection &other)
Assignment operator.
Definition EnumSelection.cxx:106
std::string candidates_str() const
Stringified candidates.
Definition EnumSelection.cxx:127
const std::unordered_map< std::string, int > & candidates() const
Candidates.
Definition EnumSelection.h:80
bool operator!=(const EnumSelection &other) const
Test for inequality.
Definition EnumSelection.cxx:121
friend std::stringstream & operator>>(std::stringstream &ss, EnumSelection &)
Definition EnumSelection.cxx:38
bool operator==(const EnumSelection &other) const
Test for inequality.
Definition EnumSelection.cxx:115
Definition CrossRef.cxx:30
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