31template <
typename EnumType_>
83 constexpr void set(
const BitField& other) { m_bits |= other.m_bits; }
90 constexpr void clear(
const BitField& other) { m_bits &= ~other.m_bits; }
106 return (m_bits & other.m_bits) == other.m_bits;
116 constexpr bool test_any(
const BitField& other)
const {
return (m_bits & other.m_bits) != 0; }
172 return BitField(m_bits | other.m_bits);
184 return BitField(m_bits & other.m_bits);
196 return BitField(m_bits ^ other.m_bits);
207 static_assert(std::is_enum_v<EnumType>);
Bit field utility class.
Definition: BitField.h:33
constexpr BitField operator^(const BitField &other) const
Bitwise 'exclusive or' operator.
Definition: BitField.h:194
constexpr BitField(EnumType value)
Constructor.
Definition: BitField.h:51
std::underlying_type_t< EnumType > UnderlyingType
Underlying integral type representing the enum type.
Definition: BitField.h:39
constexpr void set_bit(const BitField &other, bool is_set)
Allow to set the value of a bit.
Definition: BitField.h:124
constexpr BitField(UnderlyingType bits)
Constructor.
Definition: BitField.h:60
constexpr const UnderlyingType & get_value() const
Gets the underlying integral value.
Definition: BitField.h:143
constexpr bool operator!=(const BitField &other) const
Different operator.
Definition: BitField.h:161
constexpr void set(const BitField &other)
Set to 1 the specified bit.
Definition: BitField.h:83
constexpr BitField operator&(const BitField &other) const
Bitwise 'and' operator.
Definition: BitField.h:182
constexpr bool test_any(const BitField &other) const
Test if any bits are set.
Definition: BitField.h:116
constexpr bool test(const BitField &other) const
Test the specified bit.
Definition: BitField.h:104
constexpr void clear(const BitField &other)
Set to 0 the specified Bit.
Definition: BitField.h:90
constexpr void clear_all()
Set all bits to 0.
Definition: BitField.h:95
static constexpr BitField all()
Named constructor returning a bitfield set to 1.
Definition: BitField.h:76
constexpr bool operator==(const BitField &other) const
Equal operator.
Definition: BitField.h:152
constexpr BitField()
Default Constructor.
Definition: BitField.h:42
constexpr BitField operator~() const
Bitwise 'one's complement' operator.
Definition: BitField.h:204
EnumType_ EnumType
Enum type on top of which the bit field is built.
Definition: BitField.h:36
constexpr BitField operator|(const BitField &other) const
Bitwise 'or' operator.
Definition: BitField.h:170
static constexpr BitField none()
Named constructor returning a bitfield set to 0.
Definition: BitField.h:69
Main namespace for Lagrange.
Definition: AABBIGL.h:30