4#include "include/types.hpp"
46 uint8_t *head{
nullptr };
47 uint8_t *tail{
nullptr };
48 uint8_t *writer{
nullptr };
49 uint8_t *reader{
nullptr };
50 volatile size_t itemsWaiting = 0U;
51 size_t itemsCount = 0U;
53 void moveReader(
void )
noexcept;
54 void copyDataFromQueue(
void *
const dst )
noexcept;
55 void copyDataToQueue(
const void *itemToQueue,
const queueSendMode xPosition )
noexcept;
57 void operator=(
queue const& ) =
delete;
71 bool setup(
void *pData,
const size_t size,
const size_t count )
noexcept;
103 size_t count(
void )
const noexcept;
144 void*
peek(
void )
const noexcept;
A Queue object.
Definition queue.hpp:44
bool receive(void *dst) noexcept
Receive an item from a queue (and removes it). The item is received by copy so a buffer of adequate s...
void * peek(void) const noexcept
Looks at the data from the front of the Queue without removing it.
size_t itemsAvailable(void) const noexcept
Returns the number of available slots to hold items inside the queue.
bool isEmpty(void) const noexcept
Returns the empty status of the Queue.
size_t getItemSize(void) const noexcept
Get the size(in bytes) used for every item in the queue.
void reset(void) noexcept
Resets a queue to its original empty state.
size_t count(void) const noexcept
Returns the number of items in the Queue.
bool isInitialized(void) const noexcept
Check if the queue is already initialized by using queue::setup()
bool setup(void *pData, const size_t count) noexcept
Configures a Queue. Here, the RAM used to hold the queue data pData is statically allocated at compil...
Definition queue.hpp:81
bool setup(void *pData, const size_t size, const size_t count) noexcept
Configures a Queue. Here, the RAM used to hold the queue data pData is statically allocated at compil...
bool isFull(void) const noexcept
Returns the full status of the Queue.
bool send(void *itemToQueue, const queueSendMode pos=queueSendMode::TO_BACK) noexcept
Post an item to the the queue. The item is queued by copy, not by reference.
bool removeFront(void) noexcept
Remove the data located at the front of the Queue.
queueSendMode
An enum that defines the modes in which a item should be inserted in to a queue.
Definition queue.hpp:17
OS/Kernel interfaces.
Definition bytebuffer.hpp:7