Public Types | Public Member Functions | Static Public Member Functions | List of all members
EnumFlagger< F > Class Template Reference

Flagger accepting values of enum type E. More...

#include <EnumFlags.h>

Inheritance diagram for EnumFlagger< F >:
Inheritance graph
[legend]
Collaboration diagram for EnumFlagger< F >:
Collaboration graph
[legend]

Public Types

typedef F fbase_t
 
typedef F::value_t value_t
 
typedef F::storage_t storage_t
 
typedef F::dict_t dict_t
 
typedef FlagResolver::ivalue_t ivalue_t
 

Public Member Functions

 EnumFlagger ()
 Default constructor.
 
 EnumFlagger (const storage_t &v)
 Constructor with initial value.
 
template<typename ... T>
 EnumFlagger (const T &... arg)
 
EnumFlagger< F > & operator= (const EnumFlagger< F > &flagger)
 
template<class T >
EnumFlagger< F > & operator= (const T &v)
 

Static Public Member Functions

static ivalue_t getValueNEW (const std::string &key)
 Returns the static dictionary created for this value_t . More...
 

Detailed Description

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}};

Member Function Documentation

◆ getValueNEW()

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.

◆ operator=()

EnumFlagger<F>& operator= ( const EnumFlagger< F > &  flagger)
inline
Dictionary throws except if key now found.

static value_t getKeys(const value_t & value){ return (value_t)EnumDict<value_t>::dict.getValue(key); }; Consider handler through this->set(Flagger) ? Needs protected/private _set() (or assign()).


The documentation for this class was generated from the following file: