Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SingleFlagger< E > Class Template Reference

#include <Flags.h>

Inheritance diagram for SingleFlagger< E >:
Inheritance graph
[legend]
Collaboration diagram for SingleFlagger< E >:
Collaboration graph
[legend]

Public Types

typedef E value_t
 
typedef E storage_t
 
typedef FlaggerBase< E, E > flagger_t
 
typedef flagger_t::dict_t dict_t
 
typedef dict_t::key_t key_t
 
- Public Types inherited from FlaggerBase< E, E >
typedef E value_t
 
typedef E storage_t
 
typedef Dictionary< std::string, E > dict_t
 
typedef dict_t::key_t key_t
 

Public Member Functions

virtual const dict_tgetDict () const override
 Returns the static dictionary created for this value_t . More...
 
 SingleFlagger (const dict_t &dict)
 
 SingleFlagger (const dict_t &dict, const storage_t &v)
 
 SingleFlagger (const dict_t &dict, storage_t &v, char sep=',')
 
virtual bool isSet (const storage_t &x) const override
 Return true, if value is exactly x .
 
template<class T >
SingleFlagger< E > & operator= (const T &v)
 
virtual const key_t & str () const override
 String corresponding the current value. Returns empty, if not found.
 
- Public Member Functions inherited from FlaggerBase< E, E >
 FlaggerBase (char separator=',')
 
 FlaggerBase (storage_t &v, char separator=',')
 Value-referencing constructor. More...
 
virtual void reset ()
 
virtual void set (const key_t &key)
 Sets one or several flags.
 
virtual void set (const value_t &value)
 Set a single flag.
 
virtual void set (const FlaggerBase< E > &flagger)
 
bool isSet (const key_t &key) const
 
const storage_t & getValue () const
 
 operator const storage_t & () const
 Given an integer, retrieves dictionary keys corresponding to each index of set bits.
 
 operator storage_t & ()
 
 operator bool () const
 
 operator const key_t & () const
 
void debug (std::ostream &ostr) const
 

Protected Member Functions

virtual void assign (const std::string &key) override
 Assign key. Expects a single key, not a combination of keys. More...
 

Protected Attributes

const dict_tdict
 

Additional Inherited Members

- Public Attributes inherited from FlaggerBase< E, E >
storage_t & value
 
char separator
 

Detailed Description

template<typename E>
class drain::SingleFlagger< E >

Abstract class, because getDict() returning Dictionary<std::string,E> still undefined.

Member Function Documentation

◆ assign()

virtual void assign ( const std::string &  key)
inlineoverrideprotectedvirtual

Assign key. Expects a single key, not a combination of keys.

By definition, SingleFlagger contains a value that corresponds to a single key, at a time.

MultiFlagger::assign() supports setting several keys at once.

Implements FlaggerBase< E, E >.

◆ getDict()

virtual const dict_t& getDict ( ) const
inlineoverridevirtual

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.

Implements FlaggerBase< E, E >.


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