FreeRTOS-Cpp
|
Class that encapsulates the functionality of a FreeRTOS queue. More...
#include <FreeRTOS/Queue.hpp>
Public Member Functions | |
StaticQueue () | |
Construct a new StaticQueue object by calling QueueHandle_t xQueueCreateStatic( UBaseType_t uxQueueLength, UBaseType_t uxItemSize, uint8_t *pucQueueStorageBuffer, StaticQueue_t *pxQueueBuffer ) More... | |
StaticQueue (const StaticQueue &)=delete | |
StaticQueue & | operator= (const StaticQueue &)=delete |
StaticQueue (StaticQueue &&) noexcept=default | |
StaticQueue & | operator= (StaticQueue &&) 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... | |
Private Attributes | |
StaticQueue_t | staticQueue |
uint8_t | storage [N *sizeof(T)] |
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.
If a queue is created using this class then the RAM is provided by the application writer as part of the object instance and allows the RAM to be statically allocated at compile time.
T | Type to be stored in the queue. |
N | The maximum number of items the queue can hold at any one time. |
|
inline |
Construct a new StaticQueue object by calling QueueHandle_t xQueueCreateStatic( UBaseType_t uxQueueLength, UBaseType_t uxItemSize, uint8_t *pucQueueStorageBuffer, StaticQueue_t *pxQueueBuffer )
Example Usage