|
| FlagSet ()=default |
|
| FlagSet (This_t const &)=default |
|
| FlagSet (This_t &&)=default |
|
FlagSet & | operator= (This_t const &)=default |
|
FlagSet & | operator= (This_t &&)=default |
|
constexpr | FlagSet (Mask_t const &from) |
| Constructor: copy the specified mask. More...
|
|
template<typename Stream > |
void | dump (Stream &&out) const |
| Dumps on screen only the "official" flags (see size() ). More...
|
|
|
constexpr Mask_t const & | mask () const |
| Returns all the flags in the form of a mask. More...
|
|
constexpr bool | isFlag (FlagIndex_t flagIndex) const |
| Returns whether the flag index is valid. More...
|
|
constexpr bool | isFlag (Flag_t flag) const |
| Returns whether the flag index is valid. More...
|
|
bool | test (Flag_t flag) const |
| Returns if the specified flag is set. More...
|
|
bool | test (FlagIndex_t flagIndex) const |
| Returns if the specified flag is set. More...
|
|
constexpr bool | operator== (Mask_t const &other) const |
|
constexpr bool | operator!= (Mask_t const &other) const |
|
template<typename Stream > |
void | dump (Stream &&out, unsigned int nBits) const |
| Prints into the specified stream the least nBits significant bits. More...
|
|
template<typename Stream > |
void | dump (Stream &&out) const |
| Prints into the specified stream all bits. More...
|
|
constexpr | BitMask ()=default |
| Default constructor: no flag defined at all. More...
|
|
constexpr | BitMask (BitMaskFromValuesTag, Storage_t defined) |
| Constructor: defines and sets flags. More...
|
|
constexpr | BitMask (BitMaskFromValuesTag, Storage_t defined, Storage_t values) |
| Constructor: defines and sets flags. More...
|
|
constexpr | BitMask (BitMaskFromValuesTag, Bits_t values) |
| Constructor: defines and sets flags. More...
|
|
constexpr | BitMask (BitMaskFromValuesTag, Bits_t defined, Bits_t values) |
| Constructor: defines and sets flags. More...
|
|
template<typename... Others> |
constexpr | BitMask (Flag_t first, Others...others) |
| Constructor: merges all arguments in the argument list. More...
|
|
template<typename... Others> |
constexpr | BitMask (Bits_t first, Others...others) |
| Constructor: merges all arguments in the argument list. More...
|
|
template<typename Second , typename... Others> |
constexpr | BitMask (Mask_t first, Second second, Others...others) |
| Constructor: merges all arguments in the argument list. More...
|
|
constexpr bool | isDefined (Flag_t flag) const |
| Returns whether the flag is defined. More...
|
|
constexpr bool | isDefined (Bits_t bits) const |
| Returns whether all specified bits are defined. More...
|
|
constexpr bool | isUndefined (Flag_t flag) const |
| Returns whether the flag is undefined. More...
|
|
constexpr bool | isUndefined (Bits_t bits) const |
| Returns whether all specified bits are undefined. More...
|
|
constexpr bool | get (Flag_t flag) const |
| Returns if the specified flag is on ("set"). More...
|
|
constexpr bool | isSet (Flag_t flag) const |
| Returns if the specified flag is set. More...
|
|
constexpr bool | isUnset (Flag_t flag) const |
| Returns if the specified flag is unset. More...
|
|
constexpr bool | all (Bits_t bits) const |
| Returns whether all the specified bits are set. More...
|
|
constexpr bool | any (Bits_t bits) const |
| Returns whether at least one of the specified bits is set. More...
|
|
constexpr bool | none (Bits_t bits) const |
| Returns whether all the specified bits are unset. More...
|
|
constexpr bool | anySet (Mask_t const &mask) const |
| Returns whether any of the bits set in the mask are set. More...
|
|
constexpr bool | noneSet (Mask_t const &mask) const |
| Returns whether none of the bits set in the mask is set. More...
|
|
constexpr bool | match (Mask_t const &mask) const |
| Returns whether all bits defined in the mask are equal to ours. More...
|
|
template<typename Flag , typename... OtherFlags> |
void | set (Flag first, OtherFlags...others) |
| Sets all specified flags. More...
|
|
template<typename BeginIter , typename EndIter > |
void | rangeSet (BeginIter begin, EndIter end) |
| Sets all flags specified by the index iterator range. More...
|
|
template<typename Flag , typename... OtherFlags> |
void | unset (Flag first, OtherFlags...others) |
| Unsets all specified flags. More...
|
|
template<typename BeginIter , typename EndIter > |
void | rangeUnset (BeginIter begin, EndIter end) |
| Unsets all flags specified by the index iterator range. More...
|
|
template<typename Flag , typename... OtherFlags> |
void | remove (Flag first, OtherFlags...others) |
| Declares all specified flags as undefined. More...
|
|
void | clear () |
| Undefines all bits. More...
|
|
|
static constexpr size_t | size () |
| Returns the number of flags the set supports. More...
|
|
template<typename... Args> |
static constexpr Mask_t | createMask (Args...args) |
| Creates a new BitMask. More...
|
|
static constexpr size_t | capacity () |
| Returns the number of flags the set has room for. More...
|
|
template<typename... Args> |
static constexpr Mask_t | create (Args...args) |
| Creates a new BitMask. More...
|
|
static constexpr Mask_t | mergeIntoMask (Mask_t baseMask, Mask_t mask) |
| Returns a new mask with the content of the other mask merged. More...
|
|
static constexpr Mask_t | mergeIntoMask (Mask_t baseMask, Bits_t bits) |
| Returns a new mask with the specified bits defined and set. More...
|
|
static constexpr Mask_t | mergeIntoMask (Mask_t baseMask, Flag_t flag) |
| Returns a new mask with the specified flag defined and set. More...
|
|
static constexpr Mask_t | combineWithMask (Mask_t A, Mask_t B) |
| Returns a new mask combining bits set from two masks. More...
|
|
static constexpr Mask_t | combineWithMask (Mask_t baseMask, Bits_t bits) |
| Returns a new mask with the specified flag defined and set. More...
|
|
static constexpr Mask_t | combineWithMask (Mask_t baseMask, Flag_t flag) |
| Returns a new mask with the specified flag defined and set. More...
|
|
static constexpr Mask_t | intersectWithMask (Mask_t A, Mask_t B) |
| Returns a new mask with the bits set from both masks. More...
|
|
static constexpr Mask_t | intersectWithMask (Mask_t baseMask, Bits_t bits) |
| Returns a new mask with only the specified bits set. More...
|
|
static constexpr Mask_t | intersectWithMask (Mask_t baseMask, Flag_t flag) |
| Returns a new mask with the specified flag as only set flag. More...
|
|
static constexpr Mask_t | unsetMask (Mask_t baseMask, Mask_t mask) |
| Returns a new mask with the bits set from both masks. More...
|
|
static constexpr Mask_t | unsetMask (Mask_t baseMask, Bits_t bits) |
| Returns a new mask with only the specified bits set. More...
|
|
static constexpr Mask_t | unsetMask (Mask_t baseMask, Flag_t flag) |
| Returns a new mask with the specified flag as only set flag. More...
|
|
static constexpr Mask_t | negateMask (Mask_t mask) |
| Returns the negation of mask. More...
|
|
static constexpr Mask_t | negateMask (Bits_t bits) |
| Returns a new mask with the specified bits unset. More...
|
|
static constexpr Mask_t | negateMask (Flag_t flag) |
| Returns a new mask with the specified flag unset. More...
|
|
template<unsigned int NFlags, typename Storage = details::smallestUInt_t<NFlags>>
class util::flags::FlagSet< NFlags, Storage >
A class containing a set of flags.
- Template Parameters
-
NFlags | number of flags to be allocated |
Storage | underlying integral type whose bits represent the flags |
A FlagSet contains a set of flags. Each flag can be in one of two states ("set" and "unset"), or can be not defined at all ("undefined").
Note that the object might have a capacity()
larger than just NFlags
. The flags after the first NFlags
are "unsupported", in the sense that in future implementations they might disappear. For the rest, they behave just like the other flags though.
Definition at line 41 of file FlagSet.h.