FreeRTOS-Cpp
|
Class that encapsulates the functionality of a FreeRTOS queue. More...
#include <FreeRTOS/Queue.hpp>
Public Member Functions | |
Queue (const UBaseType_t length) | |
Construct a new Queue object by calling QueueHandle_t xQueueCreate( UBaseType_t uxQueueLength, UBaseType_t uxItemSize ) More... | |
Queue (const Queue &)=delete | |
Queue & | operator= (const Queue &)=delete |
Queue (Queue &&) noexcept=default | |
Queue & | operator= (Queue &&) noexcept=default |
![]() | |
QueueBase (const QueueBase &)=delete | |
QueueBase & | operator= (const QueueBase &)=delete |
bool | isValid () const |
Function that checks if the underlying queue handle is not NULL. This should be used to ensure a queue has been created correctly. More... | |
bool | sendToBack (const T &item, const TickType_t ticksToWait=portMAX_DELAY) const |
Function that calls xQueueSendToBack( xQueue, pvItemToQueue, xTicksToWait ) More... | |
bool | sendToBackFromISR (bool &higherPriorityTaskWoken, const T &item) const |
Function that calls xQueueSendToBackFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) More... | |
bool | sendToBackFromISR (const T &item) const |
Function that calls xQueueSendToBackFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) More... | |
bool | sendToFront (const T &item, const TickType_t ticksToWait=portMAX_DELAY) const |
Function that calls xQueueSendToFront( xQueue, pvItemToQueue, xTicksToWait ) More... | |
bool | sendToFrontFromISR (bool &higherPriorityTaskWoken, const T &item) const |
Function that calls xQueueSendToFrontFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) More... | |
bool | sendToFrontFromISR (const T &item) const |
Function that calls xQueueSendToFrontFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) More... | |
std::optional< T > | receive (const TickType_t ticksToWait=portMAX_DELAY) const |
Function that calls BaseType_t xQueueReceive( QueueHandle_t xQueue, void *pvBuffer, TickType_t xTicksToWait ) More... | |
std::optional< T > | receiveFromISR (bool &higherPriorityTaskWoken) const |
Function that calls BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue, void *pvBuffer, BaseType_t *pxHigherPriorityTaskWoken ) More... | |
std::optional< T > | receiveFromISR () const |
Function that calls BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue, void *pvBuffer, BaseType_t *pxHigherPriorityTaskWoken ) More... | |
UBaseType_t | messagesWaiting () const |
Function that calls UBaseType_t uxQueueMessagesWaiting( QueueHandle_t xQueue ) More... | |
UBaseType_t | messagesWaitingFromISR () const |
Function that calls UBaseType_t uxQueueMessagesWaitingFromISR( QueueHandle_t xQueue ) More... | |
UBaseType_t | spacesAvailable () const |
Function that calls UBaseType_t uxQueueSpacesAvailable( QueueHandle_t xQueue ) More... | |
void | reset () const |
Function that calls BaseType_t xQueueReset( QueueHandle_t xQueue ) More... | |
void | overwrite (const T &item) const |
Function that calls BaseType_t xQueueOverwrite( QueueHandle_t xQueue, const void * pvItemToQueue ) More... | |
void | overwriteFromISR (bool &higherPriorityTaskWoken, const T &item) const |
Function that calls BaseType_t xQueueOverwriteFromISR( QueueHandle_t xQueue, const void * pvItemToQueue, BaseType_t *pxHigherPriorityTaskWoken ) More... | |
void | overwriteFromISR (const T &item) const |
Function that calls BaseType_t xQueueOverwriteFromISR( QueueHandle_t xQueue, const void * pvItemToQueue, BaseType_t *pxHigherPriorityTaskWoken ) More... | |
std::optional< T > | peek (const TickType_t ticksToWait=portMAX_DELAY) const |
Function that calls BaseType_t xQueuePeek( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait ) More... | |
std::optional< T > | peekFromISR () const |
Function that calls BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue, void *pvBuffer ) More... | |
void | addToRegistry (const char *name) const |
Function that calls void vQueueAddToRegistry( QueueHandle_t xQueue, char *pcQueueName ) More... | |
void | unregister () const |
Function that calls void vQueueUnregisterQueue( QueueHandle_t xQueue ) More... | |
const char * | getName () const |
Function that calls const char *pcQueueGetName( QueueHandle_t xQueue ) More... | |
bool | isFullFromISR () const |
Function that calls BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) More... | |
bool | isEmptyFromISR () const |
Function that calls BaseType_t xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue ) More... | |
Additional Inherited Members | |
![]() | |
static void * | operator new (size_t, void *ptr) |
static void * | operator new[] (size_t, void *ptr) |
static void * | operator new (size_t)=delete |
static void * | operator new[] (size_t)=delete |
Class that encapsulates the functionality of a FreeRTOS queue.
Each queue requires RAM that is used to hold the queue state, and to hold the items that are contained in the queue (the queue storage area). If a queue is created using this class then the required RAM is automatically allocated from the FreeRTOS heap.
T | Type to be stored in the queue. |
|
inlineexplicit |
Construct a new Queue object by calling QueueHandle_t xQueueCreate( UBaseType_t uxQueueLength, UBaseType_t uxItemSize )
length | The maximum number of items the queue can hold at any one time. |
Example Usage