![]() |
|
#include <FlagBase.h>
Public Types | |
typedef E | value_t |
typedef T | storage_t |
typedef Dictionary< std::string, E > | dict_t |
typedef dict_t::key_t | key_t |
Public Member Functions | |
virtual const dict_t & | getDict () const =0 |
Returns the static dictionary created for this value_t . | |
virtual void | reset () |
virtual bool | isSet (const storage_t &x) const =0 |
Checks if a given bit, or any of given bits, is set. | |
bool | isSet (const key_t &key) const |
const storage_t & | getValue () const |
operator const storage_t & () const | |
operator storage_t & () | |
operator bool () const | |
virtual const key_t & | str () const =0 |
String corresponding the current value. Returns empty, if not found. | |
operator const key_t & () const | |
void | debug (std::ostream &ostr) const |
Public Attributes | |
storage_t & | value |
char | separator |
Protected Member Functions | |
FlaggerBase (char separator=',') | |
FlaggerBase (storage_t &v, char separator=',') | |
Value-referencing constructor. | |
A Flag mapper designed for global use, also supporting ENUM types. @See Perhaps replacing GlobalFlagger later.
Example:
Inside a class:
E | - single-value type: enum or integer |
T | - storage type (bit vector, "state"). T should not be enum, if E is numeric. |
|
inlineprotected |
Value-referencing constructor.
An external value will be used, leaving protected ownValue
unused . Reconsider design. Should the value ever be referenced?
|
pure virtual |
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.
Implemented in SingleFlagger< E >, SingleFlagger< AlignBase::Axis >, SingleFlagger< Crit >, SingleFlagger< Direction >, SingleFlagger< Oper >, SingleFlagger< PIXEL_ADJACENCY >, SingleFlagger< Prf >, SingleFlagger< TextStyle::Colour >, SingleFlagger< TextStyle::Line >, MultiFlagger< E, T >, MultiFlagger< ElemClass >, MultiFlagger< group_t, group_t >, MultiFlagger< int >, MultiFlagger< Mode >, MultiFlagger< OutputDataVerbosity >, MultiFlagger< PathPolicy >, MultiFlagger< Status >, MultiFlagger< SvgInclude >, and MultiFlagger< TextStyle::Style >.
|
pure virtual |
Checks if a given bit, or any of given bits, is set.
SingleFlagger: exact match MultiFlagger: bitwise OR > 0
Implemented in SingleFlagger< E >, and MultiFlagger< E, T >.
|
pure virtual |
String corresponding the current value. Returns empty, if not found.
Implemented in SingleFlagger< E >, SingleFlagger< AlignBase::Axis >, SingleFlagger< Crit >, SingleFlagger< Direction >, SingleFlagger< Oper >, SingleFlagger< PIXEL_ADJACENCY >, SingleFlagger< Prf >, SingleFlagger< TextStyle::Colour >, SingleFlagger< TextStyle::Line >, MultiFlagger< E, T >, MultiFlagger< ElemClass >, MultiFlagger< group_t, group_t >, MultiFlagger< int >, MultiFlagger< Mode >, MultiFlagger< OutputDataVerbosity >, MultiFlagger< PathPolicy >, MultiFlagger< Status >, MultiFlagger< SvgInclude >, and MultiFlagger< TextStyle::Style >.