|
|
| MultiFlagger (const dict_t &dict) |
| |
|
template<typename ... V> |
| | MultiFlagger (const dict_t &dict, const V &... args) |
| |
| | MultiFlagger (const dict_t &dict, storage_t &target, char sep=',') |
| |
| virtual const dict_t & | getDict () const override |
| | Returns the static dictionary created for this value_t .
|
| |
| virtual bool | isSet (const storage_t &x) const override |
| | Return true, all the bits of argument x are set.
|
| |
|
bool | isAnySet (const storage_t &x) const |
| | Return true, all the bits of argument x are set.
|
| |
|
void | unset (const storage_t &x) |
| | Unset some bit(s).
|
| |
| template<typename ... V> |
| void | set (const V &... args) |
| | Set bits, accepting numeric values or keys.
|
| |
|
template<typename V , typename ... VV> |
| void | add (const V &arg, const VV &... args) |
| | Add bit values.
|
| |
| virtual const key_t & | str () const override |
| | For exporting values.
|
| |
|
virtual std::string & | str () |
| | For importing values. After assignment, update() should be called. Experimental.
|
| |
|
virtual void | reset () |
| |
|
bool | isSet (const key_t &key) const |
| |
|
const storage_t & | getValue () const |
| |
|
| operator const storage_t & () const |
| |
|
| operator storage_t & () |
| |
|
| operator bool () const |
| |
|
| operator const key_t & () const |
| |
|
void | debug (std::ostream &ostr) const |
| |
template<typename E, typename T = size_t>
class drain::MultiFlagger< E, T >
Note that if enum definition contains overlapping (combined) values, SingleFlagger may be sufficient. If arbitrary bit combinations should be supported, MultiFlagger must be used. Example {USER=1, GROUP=2, OTHER=4, ALL=USER|GROUP|OTHER}.
Abstract class, because getDict() returning Dictionary<std::string,E> still undefined.
template<typename E , typename T = size_t>
| 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, T >.