![]() |
Gamedev Framework (gf)
0.2.0
A C++11 framework for 2D games
|
Bitfield relying on an enumeration. More...
#include <gf/Flags.h>
Public Member Functions | |
constexpr | Flags () |
Default constructor. More... | |
constexpr | Flags (E e) |
Constructor with an enum value. More... | |
constexpr Flags< E > | operator~ () const |
Binary NOT operator. More... | |
Flags< E > & | operator|= (const Flags< E > &flags) |
Binary OR and assignment. More... | |
Flags< E > & | operator&= (const Flags< E > &flags) |
Binary AND and assignment. More... | |
operator bool () const | |
Test if any flag is set. More... | |
bool | test (E flag) const |
Test if a specified flag is set. More... | |
void | set (E flag) |
Set a flag. More... | |
void | reset (E flag) |
Reset a flag. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename E > | |
Flags< E > | operator| (Flags< E > lhs, Flags< E > rhs) |
Binary OR between two bitfields. More... | |
template<typename E > | |
Flags< E > | operator| (Flags< E > lhs, E rhs) |
Binary OR between a bitfield and a flag. More... | |
template<typename E > | |
Flags< E > | operator& (Flags< E > lhs, Flags< E > rhs) |
Binary AND between two bitfields. More... | |
template<typename E > | |
Flags< E > | operator& (Flags< E > lhs, E rhs) |
Binary AND between a bitfield and a flag. More... | |
Bitfield relying on an enumeration.
Constructor with an enum value.
e | An enum value |
Test if any flag is set.
Binary AND and assignment.
flags | Another bitfield |
Binary OR and assignment.
flags | Another bitfield |
Binary NOT operator.
Reset a flag.
flag | The flag to reset |
Set a flag.
flag | The flag to set |
Test if a specified flag is set.
flag | The flag to test |
Binary AND between two bitfields.
lhs | The first bitfield |
rhs | The second bitfield |
Binary AND between a bitfield and a flag.
lhs | The bitfield |
rhs | The flag |
Binary OR between two bitfields.
lhs | The first bitfield |
rhs | The second bitfield |