27#include "neml2/base/EnumSelectionBase.h"
32class MultiEnumSelection;
33std::ostream &
operator<<(std::ostream &,
const MultiEnumSelection &);
34std::stringstream &
operator>>(std::stringstream &, MultiEnumSelection &);
51 const std::vector<int> &
values,
65 operator std::vector<std::string>()
const {
return _selections; }
68 operator std::vector<int>()
const {
return _values; }
72 std::vector<T>
as()
const
75 for (
const auto &
v : _values)
76 ret.push_back(
static_cast<T
>(
v));
82 std::vector<std::string> _selections;
85 std::vector<int> _values;
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 multiple enum value from a list of candidates.
Definition MultiEnumSelection.h:41
std::vector< T > as() const
Statically cast the enum value to a C++ enum class.
Definition MultiEnumSelection.h:72
bool operator==(const MultiEnumSelection &other) const
Test for inequality.
Definition MultiEnumSelection.cxx:60
void select(const std::vector< std::string > &selections)
Definition MultiEnumSelection.cxx:73
MultiEnumSelection()=default
bool operator!=(const MultiEnumSelection &other) const
Test for inequality.
Definition MultiEnumSelection.cxx:67
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