9#include <AH/Error/Error.hpp>
33 bool get(uint16_t bitIndex)
const {
43 void set(uint16_t bitIndex) {
65 void set(uint16_t bitIndex,
bool state) {
66 state ?
set(bitIndex) :
clear(bitIndex);
79 ERROR(F(
"Error: index out of bounds (")
99 const uint8_t &
getByte(uint16_t byteIndex)
const {
122 void setByte(uint16_t byteIndex, uint8_t value) {
123 buffer[byteIndex] = value;
#define BEGIN_AH_NAMESPACE
#define AH_DIAGNOSTIC_POP()
#define AH_DIAGNOSTIC_WERROR()
A class for arrays of bits.
void set(uint16_t bitIndex)
Set the value of the given bit to 1.
uint8_t getBufferMask(uint16_t bitIndex) const
uint8_t & getByte(uint16_t byteIndex)
Get the byte at the given index.
uint16_t safeIndex(uint16_t byteIndex) const
Check the given byte index, and return it if it is within the bounds of the array,...
void setByte(uint16_t byteIndex, uint8_t value)
Set the byte at the given index.
uint8_t getBufferBit(uint16_t bitIndex) const
uint16_t getBufferLength() const
Get the buffer length in bytes.
const uint8_t & getByte(uint16_t byteIndex) const
Get the byte at the given index.
uint8_t buffer[bufferLength]
void clear(uint16_t bitIndex)
Clear the value of the given bit to 0.
uint16_t getBufferIndex(uint16_t bitIndex) const
void set(uint16_t bitIndex, bool state)
Set the value of the given bit to the given state.
static constexpr uint16_t bufferLength
bool get(uint16_t bitIndex) const
Get the value of the given bit.
#define ERROR(msg, errc)
Print the error message and error code, and stop the execution if FATAL_ERRORS are enabled.