|
| | Flags (None_type) |
| | Make an empty bitmap.
|
|
| Flags () |
| | Make default Flags.
|
| | Flags (BITS_ENUM e) |
| | Make flags from bit name.
|
|
| operator bool () const |
| | Support for if (flags) syntax (test for non-empty flags).
|
|
bool | operator! () const |
| | Support for if (!flags) syntax (test for empty flags).
|
|
type & | operator|= (type rhs) |
| | Support |= of two compatible Flags types.
|
|
type & | operator|= (bits_enum_type rhs) |
| | Support |= of Flags type and bit name.
|
|
type & | operator&= (type rhs) |
| | Support &= of two compatible Flags types.
|
|
type & | operator&= (bits_enum_type rhs) |
| | Support &= of Flags type and bit name.
|
|
type | operator~ () const |
| | Support ~ for Flags types.
|
| type & | clear (bits_enum_type flag) |
| | Clear the given flag.
|
|
value_type | as_value () const |
| | Get the underlying value.
|
template<typename BITS_ENUM, typename UNDERLYING = unsigned long>
class L4::Types::Flags< BITS_ENUM, UNDERLYING >
Template for defining typical Flags bitmaps.
- Template Parameters
-
| BITS_ENUM | enum type that defines a name for each bit in the bitmap. The values of the enum members must be the number of the bit (not a mask). |
| UNDERLYING | The underlying data type used to represent the bitmap. |
The resulting data type provides a type-safe version that allows bitwise and and or operations with the BITS_ENUM members. As well as, test for 0or !0.
Example:
enum Test_flag
{
Do_weak_tests,
Do_strong_tests
};
Test_flags x = Do_weak_tests;
if (x & Do_strong_tests) { ... }
x |= Do_strong_tests;
if (x & Do_strong_tests) { ... }
Template for defining typical Flags bitmaps.
Definition at line 52 of file types.