Convenience class for organising boolean flags. More...
#include <flags.hpp>
Public Member Functions | |
void | clear () |
Flags () | |
Flags (const Flags< Enum > &other) | |
Flags (Enum flag) | |
operator int () const | |
Flags< Enum > | operator& (int mask) const |
Flags< Enum > | operator& (Enum flag) const |
Flags< Enum > & | operator&= (int mask) |
Flags< Enum > & | operator= (const Flags< Enum > &other) |
Flags< Enum > & | operator= (const Enum &flag) |
Flags< Enum > | operator^ (Flags< Enum > other) const |
Flags< Enum > | operator^ (Enum flag) const |
Flags< Enum > & | operator^= (Flags< Enum > other) |
Flags< Enum > & | operator^= (Enum flag) |
Flags< Enum > | operator| (Flags< Enum > other) const |
Flags< Enum > | operator| (Enum flag) const |
Flags< Enum > & | operator|= (Flags< Enum > other) |
Flags< Enum > & | operator|= (Enum flag) |
Flags< Enum > | operator~ () const |
bool | testFlag (Enum flag) const |
~Flags () | |
Private Attributes | |
int | value |
Friends | |
Flags< Enum > | operator| (Enum flag, Flags< Enum > flags) |
Convenience class for organising boolean flags.
This class organises a group of flags (via enums) in a convenient and typesafe manner. It is essentially a container for flags (in the form of enums) with a convenient interface on top.
Usage:
enum Settings {
Fast 0x0001,
Medium 0x0002,
Slow 0x0004,
Red 0x0010,
Blue 0x0020
}
settings = settings|Fast|Slow;
ecl::Flags< Enum >::Flags | ( | ) | [inline] |
ecl::Flags< Enum >::Flags | ( | const Flags< Enum > & | other | ) | [inline] |
ecl::Flags< Enum >::Flags | ( | Enum | flag | ) | [inline] |
ecl::Flags< Enum >::~Flags | ( | ) | [inline] |
void ecl::Flags< Enum >::clear | ( | ) | [inline] |
ecl::Flags< Enum >::operator int | ( | ) | const [inline] |
Flags<Enum> ecl::Flags< Enum >::operator& | ( | int | mask | ) | const [inline] |
Flags<Enum> ecl::Flags< Enum >::operator& | ( | Enum | flag | ) | const [inline] |
Flags<Enum>& ecl::Flags< Enum >::operator&= | ( | int | mask | ) | [inline] |
Flags<Enum>& ecl::Flags< Enum >::operator= | ( | const Flags< Enum > & | other | ) | [inline] |
Flags<Enum>& ecl::Flags< Enum >::operator= | ( | const Enum & | flag | ) | [inline] |
Flags<Enum> ecl::Flags< Enum >::operator^ | ( | Flags< Enum > | other | ) | const [inline] |
Flags<Enum> ecl::Flags< Enum >::operator^ | ( | Enum | flag | ) | const [inline] |
Flags<Enum>& ecl::Flags< Enum >::operator^= | ( | Flags< Enum > | other | ) | [inline] |
Flags<Enum>& ecl::Flags< Enum >::operator^= | ( | Enum | flag | ) | [inline] |
Flags<Enum> ecl::Flags< Enum >::operator| | ( | Flags< Enum > | other | ) | const [inline] |
Flags<Enum> ecl::Flags< Enum >::operator| | ( | Enum | flag | ) | const [inline] |
Flags<Enum>& ecl::Flags< Enum >::operator|= | ( | Flags< Enum > | other | ) | [inline] |
Flags<Enum>& ecl::Flags< Enum >::operator|= | ( | Enum | flag | ) | [inline] |
Flags<Enum> ecl::Flags< Enum >::operator~ | ( | ) | const [inline] |
bool ecl::Flags< Enum >::testFlag | ( | Enum | flag | ) | const [inline] |
int ecl::Flags< Enum >::value [private] |