template<class F>
class drain::EnumFlagger< F >
Flagger accepting values of enum type E.
- Template Parameters
-
F | – SingleFlagger<E> or MultiFlagger<E> |
Enum dictionary should be defined as follows:
template <> const drain::EnumDict<...>::dict_t drain::EnumDict<...>::dict = {{"A", A}, {"B", B}, {"C", C}};
static ivalue_t getValueNEW |
( |
const std::string & |
key | ) |
|
|
inlinestatic |
Returns the static dictionary created for this value_t
.
Notice that this function is non-static but returns a reference to a static dictionary.
In C++ virtual functions must be non-static.
This is nevertheless handy in templated design, for example.
virtual const dict_t & getDict() const override { return EnumDict<value_t>::dict; }; Return the integer value corresponding to a key. Retrieves the value directly from the dictionary. Dictionary throws except if key now found.