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 <Flags.h>

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

Public Types

typedef F fbase_t
 
typedef fbase_t::value_t value_t
 
typedef FlagResolver::ivalue_t ivalue_t
 

Public Member Functions

template<typename ... T>
 EnumFlagger (const T &... arg)
 
virtual const FlaggerBase< value_t >::dict_t & getDict () const
 Returns the static dictionary created for this value_t . More...
 
EnumFlagger< F > & operator= (const EnumFlagger< F > &flagger)
 
template<class T >
EnumFlagger< F > & operator= (const T &v)
 
 operator value_t () const
 
 operator bool () const
 

Static Public Member Functions

static ivalue_t getValueNEW (const std::string &key)
 Return the integer value corresponding to a key. More...
 
static std::string getKeysNEW2 (const value_t &value, char separator=',')
 

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

◆ getDict()

virtual const FlaggerBase<value_t>::dict_t& getDict ( ) const
inlinevirtual

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.

◆ getValueNEW()

static ivalue_t getValueNEW ( const std::string &  key)
inlinestatic

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: