33#include <NDEVR/BaseValues.h>
34#include <NDEVR/BitFlag.h>
48 lib_assert(bit < 8,
"Bit out of expected range");
50 constexpr BitReference(
const BitReference& reference)
51 : m_flag(reference.m_flag)
52 , m_bit(reference.m_bit)
55 [[nodiscard]]
constexpr bool get()
const
59 constexpr void set(
const bool& value)
63 constexpr BitReference& operator=(
const bool& b)
68 constexpr BitReference& operator=(
const BitReference& b)
70 m_flag(m_bit, b.get());
73 constexpr BitReference& operator|=(
const bool& b)
75 m_flag(m_bit, b || get());
78 constexpr BitReference& operator|=(
const BitReference& b)
80 m_flag(m_bit, b.get() || get());
83 constexpr bool operator==(
const bool& b)
const
87 constexpr bool operator!=(
const bool& b)
const
91 constexpr operator bool()
const
95 constexpr bool operator!()
const
97 return !m_flag[m_bit];
107 return static_cast<t_to
>(value.get());
112 constexpr void swap(BitReference a, BitReference b)
noexcept
A bitset that stores 8 bits (elements with only two possible values: 0 or 1, true or false,...
A convenience class used with Buffers or Vectors of bools for referencing or acting on a single bit.
The primary namespace for the NDEVR SDK.
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
constexpr t_to cast(const Angle< t_from > &value)
Casts an Angle from one backing type to another.