#include <queue.hpp>
|
| Queue (UBaseType_t maxItems, UBaseType_t itemSize) |
|
virtual | ~Queue () |
|
bool | Dequeue (void *item, TickType_t Timeout=portMAX_DELAY) |
|
bool | DequeueFromISR (void *item, BaseType_t *pxHigherPriorityTaskWoken) |
|
virtual bool | Enqueue (const void *item) |
|
virtual bool | Enqueue (const void *item, TickType_t Timeout) |
|
virtual bool | EnqueueFromISR (const void *item, BaseType_t *pxHigherPriorityTaskWoken) |
|
void | Flush () |
|
bool | IsEmpty () |
|
bool | IsFull () |
|
UBaseType_t | NumItems () |
|
UBaseType_t | NumSpacesLeft () |
|
bool | Peek (void *item, TickType_t Timeout=portMAX_DELAY) |
|
bool | PeekFromISR (void *item) |
|
Queue class wrapper for FreeRTOS queues. This class provides enqueue and dequeue operations.
- Note
- It is expected that an application will instantiate this class or one of the derived classes and use that. It is not expected that a user or application will derive from these classes.
◆ Queue()
Queue::Queue |
( |
UBaseType_t |
maxItems, |
|
|
UBaseType_t |
itemSize |
|
) |
| |
Our constructor.
- Exceptions
-
- Parameters
-
maxItems | Maximum number of items this queue can hold. |
itemSize | Size of an item in a queue. |
- Note
- FreeRTOS queues use a memcpy / fixed size scheme for queues.
◆ ~Queue()
◆ Dequeue()
bool Queue::Dequeue |
( |
void * |
item, |
|
|
TickType_t |
Timeout = portMAX_DELAY |
|
) |
| |
Remove an item from the front of the queue.
- Parameters
-
item | Where the item you are removing will be returned to. |
Timeout | How long to wait to remove an item if the queue is currently empty. |
- Returns
- true if an item was removed, false if no item was removed.
◆ DequeueFromISR()
bool Queue::DequeueFromISR |
( |
void * |
item, |
|
|
BaseType_t * |
pxHigherPriorityTaskWoken |
|
) |
| |
Remove an item from the front of the queue in ISR context.
- Parameters
-
item | Where the item you are removing will be returned to. |
pxHigherPriorityTaskWoken | Did this operation result in a rescheduling event. |
- Returns
- true if an item was removed, false if no item was removed.
◆ Enqueue() [1/2]
bool Queue::Enqueue |
( |
const void * |
item | ) |
|
|
virtual |
Add an item to the back of the queue.
- Parameters
-
item | The item you are adding. |
- Returns
- true if the item was added, false if it was not.
◆ Enqueue() [2/2]
bool Queue::Enqueue |
( |
const void * |
item, |
|
|
TickType_t |
Timeout |
|
) |
| |
|
virtual |
Add an item to the back of the queue.
- Parameters
-
item | The item you are adding. |
Timeout | How long to wait to add the item to the queue if the queue is currently full. |
- Returns
- true if the item was added, false if it was not.
◆ EnqueueFromISR()
bool Queue::EnqueueFromISR |
( |
const void * |
item, |
|
|
BaseType_t * |
pxHigherPriorityTaskWoken |
|
) |
| |
|
virtual |
Add an item to the back of the queue in ISR context.
- Parameters
-
item | The item you are adding. |
pxHigherPriorityTaskWoken | Did this operation result in a rescheduling event. |
- Returns
- true if the item was added, false if it was not.
◆ Flush()
Remove all objects from the queue.
◆ IsEmpty()
Is the queue empty?
- Returns
- true if the queue was empty when this was called, false if the queue was not empty.
◆ IsFull()
Is the queue full?
- Returns
- true if the queue was full when this was called, false if the queue was not full.
◆ NumItems()
UBaseType_t Queue::NumItems |
( |
| ) |
|
How many items are currently in the queue.
- Returns
- the number of items in the queue.
◆ NumSpacesLeft()
UBaseType_t Queue::NumSpacesLeft |
( |
| ) |
|
How many empty spaves are currently left in the queue.
- Returns
- the number of remaining spaces.
◆ Peek()
bool Queue::Peek |
( |
void * |
item, |
|
|
TickType_t |
Timeout = portMAX_DELAY |
|
) |
| |
Make a copy of an item from the front of the queue. This will not remove it from the head of the queue.
- Parameters
-
item | Where the item you are removing will be returned to. |
Timeout | How long to wait to remove an item if the queue is currently empty. |
- Returns
- true if an item was copied, false if no item was copied.
◆ PeekFromISR()
bool Queue::PeekFromISR |
( |
void * |
item | ) |
|
Make a copy of an item from the front of the queue. This will not remove it from the head of the queue.
- Parameters
-
item | Where the item you are removing will be returned to. |
- Returns
- true if an item was copied, false if no item was copied.
◆ handle
QueueHandle_t cpp_freertos::Queue::handle |
|
protected |
The documentation for this class was generated from the following files:
- src/queue.hpp
- src/freertos-addon/c++/cqueue.cpp