Flow123d
release_2.2.0-914-gf1a3a4f
|
#include <flag_array.hh>
Public Member Functions | |
constexpr | Mask ()=default |
constexpr | Mask (BitField mask, BitField set) |
Constructor. More... | |
constexpr | Mask (BitField mask) |
constexpr Mask | operator& (Mask other) const |
constexpr Mask | operator~ () const |
Mask negation. More... | |
constexpr bool | match (BitField flags) const |
Public Attributes | |
BitField | mask_ |
The mask operates only on true bits of the mask_ member. More... | |
BitField | set_ |
Values of the mask. Only bits given by mask_ are significant. More... | |
Static Private Member Functions | |
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 . More... | |
Friends | |
template<class T , int S> | |
class | FlagArray |
std::ostream & | operator<< (std::ostream &stream, const Mask &m) |
Class defines a flag mask that can set or reset certain bits to predefined values. Thus it consists of a mask
part that specifies bits which are set to the second part set
.
A Mask can be applied to an FlagArray via FlagArray::set() method, masks can be combined through the "&" operator and can be used to test flags via FlagArray::is() method.
Definition at line 64 of file flag_array.hh.
|
default |
|
inline |
Constructor.
Definition at line 70 of file flag_array.hh.
|
inline |
Simple constructor. Namely to get elementary mask for one bit, e.g.
Definition at line 80 of file flag_array.hh.
|
inlinestaticprivate |
Returns bitset set1
with bits given by mask
set to the values given by the bitset set2
.
Definition at line 113 of file flag_array.hh.
|
inline |
Returns true if bits in passed flags
are 1 on positions masked (equal to 1) by the Mask.
Definition at line 102 of file flag_array.hh.
|
inline |
Apply mask other
to *this mask. That is, join bit masks and overwrite bits given by other.mask_
by outher.set_
values. The action of the result Mask on the FlagArray (method set()
) is the same as application of *this followed by the application of other
.
Definition at line 91 of file flag_array.hh.
|
inline |
Mask negation.
Definition at line 96 of file flag_array.hh.
Definition at line 123 of file flag_array.hh.
|
friend |
Definition at line 105 of file flag_array.hh.
The mask operates only on true bits of the mask_
member.
Definition at line 118 of file flag_array.hh.
Values of the mask. Only bits given by mask_
are significant.
Definition at line 120 of file flag_array.hh.