4#include "include/types.hpp"
19 volatile byte_t *buffer{
nullptr };
23 static size_t checkValidPowerOfTwo(
size_t k )
noexcept;
37 (void)
setup( pBuffer, bLength );
39 template <
size_t numberOfBytes>
42 (void)
setup( area, numberOfBytes );
50 bool setup(
volatile byte_t *pBuffer,
const size_t bLength )
noexcept;
51 template <
size_t numberOfBytes>
54 return setup( area, numberOfBytes );
68 bool read(
void *dst,
const size_t n )
noexcept;
98 size_t count(
void )
const noexcept;
A Byte-sized buffer object.
Definition bytebuffer.hpp:17
bool isFull(void) const noexcept
Query the full status of the Byte-sized buffer.
bool setup(volatile byte_t(&area)[numberOfBytes]) noexcept
Definition bytebuffer.hpp:52
bool read(void *dst, const size_t n) noexcept
Gets n data from the Byte-sized buffer and removes them.
bool setup(volatile byte_t *pBuffer, const size_t bLength) noexcept
Initialize the Byte-sized buffer.
bool get(byte_t *dst) noexcept
Gets one data-byte from the front of the Byte-sized buffer, and removes it.
bool isEmpty(void) const noexcept
Query the empty status of the Byte-sized buffer.
bool put(const byte_t bData) noexcept
Adds an element of data to the Byte-sized buffer.
byteBuffer(volatile byte_t *pBuffer, const size_t bLength)
Initialize the Byte-sized buffer instance.
Definition bytebuffer.hpp:35
byteBuffer(volatile byte_t(&area)[numberOfBytes]) noexcept
Definition bytebuffer.hpp:40
byte_t peek(void) const noexcept
Looks for one byte from the head of the Byte-sized buffer without removing it.
size_t count(void) const noexcept
Query the number of elements in the Byte-sized buffer.
STD_TYPE_SIZE_T index_t
A type to instantiate an OS index variable. Can store the maximum size of a theoretically possible ob...
Definition types.hpp:94
STD_TYPE_UINT8_T byte_t
A type to instantiate a byte variable.
Definition types.hpp:67
OS/Kernel interfaces.
Definition bytebuffer.hpp:7