#include <icy/bitwise.h>Container for smart management of bitwise integer flags.
| Return | Name | Description |
|---|---|---|
unsigned | data | Backing storage for the flag bits. |
unsigned dataBacking storage for the flag bits.
| Return | Name | Description |
|---|---|---|
Bitwise inline | Constructs a Bitwise with optional initial flags. | |
void | reset virtual inline | Clears all flags (sets data to 0). |
void | set virtual inline | Sets the given flag only if it is not already set. |
void | add virtual inline | Unconditionally sets (OR) the given flag bits. |
void | remove virtual inline | Clears the given flag bits. |
void | toggle virtual inline | Toggles (XOR) the given flag bits. |
bool | has virtual const inline | Returns true if all bits in flag are set. |
inline
inline Bitwise(unsigned flags)Constructs a Bitwise with optional initial flags.
flags Initial flag value (default: 0).virtual inline
virtual inline void reset()Clears all flags (sets data to 0).
virtual inline
virtual inline void set(unsigned flag)Sets the given flag only if it is not already set.
flag The flag bit(s) to set.virtual inline
virtual inline void add(unsigned flag)Unconditionally sets (OR) the given flag bits.
flag The flag bit(s) to add.virtual inline
virtual inline void remove(unsigned flag)Clears the given flag bits.
flag The flag bit(s) to remove.virtual inline
virtual inline void toggle(unsigned flag)Toggles (XOR) the given flag bits.
flag The flag bit(s) to toggle.virtual const inline
virtual inline bool has(unsigned flag) constReturns true if all bits in flag are set.
flag The flag bit(s) to test.true if every bit in flag is present in data.