Flow123d
JS_before_hm-2279-gb109077a9
|
Go to the documentation of this file.
18 #ifndef FLAG_ARRAY_HH_
19 #define FLAG_ARRAY_HH_
47 template <
class Tag,
int Size = 32>
67 constexpr
Mask() =
default;
114 {
return (mask2 & set2) | (~mask2 & set1);
122 template <
class T,
int S>
129 static const unsigned int size = Size;
163 constexpr
bool match(Mask mask)
const
164 {
return mask.match(
flags_); }
BitField mask_
The mask operates only on true bits of the mask_ member.
BitField flags_
flags storage
constexpr bool match(Mask mask) const
std::bitset with generalized mask mechanism.
static constexpr BitField mask_set(BitField set1, BitField mask2, BitField set2)
Returns bitset set1 with bits given by mask set to the values given by the bitset set2.
constexpr Mask operator~() const
Mask negation.
friend std::ostream & operator<<(std::ostream &s, const FlagArray &f)
static const unsigned int size
Allocated size of flags storage.
static constexpr Mask none_mask
FlagArray()
Default constructor turns all flags off.
constexpr Mask(BitField mask, BitField set)
Constructor.
static constexpr Mask all_true_mask
static constexpr Mask all_false_mask
constexpr friend bool operator==(FlagArray left, FlagArray right)
constexpr bool match(BitField flags) const
friend std::ostream & operator<<(std::ostream &stream, const Mask &m)
FlagArray(Mask mask)
Conversion from the mask.
friend bool operator!=(FlagArray left, FlagArray right)
constexpr Mask(BitField mask)
unsigned int BitField
Declaration of internal bitfield type.
FlagArray & add(Mask mask)
IntFormatSpec< int, TypeSpec< 'x'> > hex(int value)
BitField set_
Values of the mask. Only bits given by mask_ are significant.
constexpr Mask operator&(Mask other) const