33#include <NDEVR/BaseValues.h>
34#include <NDEVR/BitFlag.h>
44 lib_assert(bit < 8,
"Bit out of expected range");
47 : m_flag(reference.m_flag)
48 , m_bit(reference.m_bit)
51 [[nodiscard]]
constexpr bool get()
const
55 constexpr void set(
const bool& value)
66 m_flag(m_bit, b.
get());
71 m_flag(m_bit, b ||
get());
76 m_flag(m_bit, b.
get() ||
get());
87 constexpr operator bool()
const
93 return !m_flag[m_bit];
103 return static_cast<t_to
>(value.
get());
#define lib_assert(expression, message)
Asserts some logic in the code. Disabled in non debug mode by default. Can be re-enabled in release u...
Definition LibAssert.h:70
A bitset that stores 8 bits (elements with only two possible values: 0 or 1, true or false,...
Definition BitFlag.hpp:68
Definition BitReference.hpp:38
constexpr BitReference & operator=(const bool &b)
Definition BitReference.hpp:59
constexpr BitReference(const BitReference &reference)
Definition BitReference.hpp:46
constexpr BitReference & operator|=(const bool &b)
Definition BitReference.hpp:69
constexpr bool get() const
Definition BitReference.hpp:51
constexpr BitReference & operator|=(const BitReference &b)
Definition BitReference.hpp:74
constexpr BitReference & operator=(const BitReference &b)
Definition BitReference.hpp:64
constexpr bool operator==(const bool &b) const
Definition BitReference.hpp:79
constexpr bool operator!=(const bool &b) const
Definition BitReference.hpp:83
constexpr bool operator!() const
Definition BitReference.hpp:91
constexpr void set(const bool &value)
Definition BitReference.hpp:55
constexpr BitReference(BitFlag &flag, uint01 bit)
Definition BitReference.hpp:40
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:98
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:514