libUTL++
|
Mix-in to provide 64-bits for space-efficient storage of up to 64 boolean flags. More...
#include <FlagsMI.h>
Public Member Functions | |
FlagsMI () | |
Constructor. More... | |
virtual | ~FlagsMI () |
Destructor. More... | |
void | copyFlags (const FlagsMI &rhs) |
Copy the given flags. More... | |
void | copyFlags (const FlagsMI &rhs, uint_t lsb, uint_t msb) |
Copy (some of) the given flags. More... | |
void | copyFlags (uint64_t flags, uint_t lsb, uint_t msb) |
Copy (some of) the given flags. More... | |
bool | getFlag (uint_t flagNum) const |
Get a user-defined flag. More... | |
void | setFlag (uint_t flagNum, bool val) |
Set a user-defined flag. More... | |
uint64_t | getFlagsNumber (uint64_t mask, uint64_t shift=0) |
Get a multi-bit value in the flags data (which is stored as one 64-bit integer). More... | |
void | setFlagsNumber (uint64_t mask, uint64_t shift, uint64_t num) |
Set a multi-bit value in the flags data (which is stored as one 64-bit integer). More... | |
uint64_t | getFlags () const |
Get the flags. More... | |
void | setFlags (uint64_t flags) |
Set the flags. More... | |
Mix-in to provide 64-bits for space-efficient storage of up to 64 boolean flags.
You can also use some of the bits to store multi-bit patterns if you wish.
|
inlinevirtual |
|
inline |
Copy (some of) the given flags.
flags | right-hand-side flags |
lsb | least significant bit (0-63) |
msb | most significant bit (0-63) |
Definition at line 65 of file FlagsMI.h.
References ASSERTD, utl::serialize(), and utl::uint64_t_max.
|
inline |
Get a user-defined flag.
flagNum | flag # (0 <= flagNum <= 63) |
Definition at line 90 of file FlagsMI.h.
References ASSERTD.
Referenced by utl::FlagGuard::FlagGuard().
|
inline |
Get a multi-bit value in the flags data (which is stored as one 64-bit integer).
Return the bitwise AND of the flags with the given 64-bit integer.
mask | bitmask (e.g. 0x3 for a two-bit number using the two least-significant bits) |
shift | the least-significant bit in the number (e.g. 0 if using the two lowest bits) |
Set a multi-bit value in the flags data (which is stored as one 64-bit integer).
mask | bitmask (e.g. 0x3 for a two-bit number using the two least-significant bits) |
shift | the least-significant bit in the number (e.g. 0 if using the two lowest bits) |
num | the number to set in the identified portion of the flags data |
|
inline |
|
inline |