FreeRTOS C++ Wrappers  1.6.0
C++ interface to FreeRTOS
Public Member Functions | List of all members
cpp_freertos::Deque Class Reference

#include <queue.hpp>

Inheritance diagram for cpp_freertos::Deque:
Inheritance graph
[legend]
Collaboration diagram for cpp_freertos::Deque:
Collaboration graph
[legend]

Public Member Functions

 Deque (UBaseType_t maxItems, UBaseType_t itemSize)
 
bool EnqueueToFront (void *item, TickType_t Timeout=portMAX_DELAY)
 
bool EnqueueToFrontFromISR (void *item, BaseType_t *pxHigherPriorityTaskWoken)
 
- Public Member Functions inherited from cpp_freertos::Queue
 Queue (UBaseType_t maxItems, UBaseType_t itemSize)
 
virtual ~Queue ()
 
virtual bool Enqueue (void *item)
 
virtual bool Enqueue (void *item, TickType_t Timeout)
 
bool Dequeue (void *item, TickType_t Timeout=portMAX_DELAY)
 
bool Peek (void *item, TickType_t Timeout=portMAX_DELAY)
 
virtual bool EnqueueFromISR (void *item, BaseType_t *pxHigherPriorityTaskWoken)
 
bool DequeueFromISR (void *item, BaseType_t *pxHigherPriorityTaskWoken)
 
bool PeekFromISR (void *item)
 
bool IsEmpty ()
 
bool IsFull ()
 
void Flush ()
 
UBaseType_t NumItems ()
 
UBaseType_t NumSpacesLeft ()
 

Additional Inherited Members

- Protected Attributes inherited from cpp_freertos::Queue
QueueHandle_t handle
 

Detailed Description

Enhanced queue class that implements a double ended queue (a "deque"), almost. Unlike the traditional CommSci version, there is no way to dequeue from the back. Practically, this most likely isn't a big deal.

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.

Definition at line 260 of file queue.hpp.

Constructor & Destructor Documentation

◆ Deque()

Deque::Deque ( UBaseType_t  maxItems,
UBaseType_t  itemSize 
)

Our constructor.

Exceptions
QueueCreateException
Parameters
maxItemsMaximum number of items thsi queue can hold.
itemSizeSize of an item in a queue.
Note
FreeRTOS queues use a memcpy / fixed size scheme for queues.

Definition at line 170 of file cqueue.cpp.

Member Function Documentation

◆ EnqueueToFront()

bool Deque::EnqueueToFront ( void *  item,
TickType_t  Timeout = portMAX_DELAY 
)

Add an item to the front of the queue. This will result in the item being removed first, ahead of all of the items added by the base calss Dequeue() function.

Parameters
itemThe item you are adding.
TimeoutHow 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.

Definition at line 176 of file cqueue.cpp.

◆ EnqueueToFrontFromISR()

bool Deque::EnqueueToFrontFromISR ( void *  item,
BaseType_t *  pxHigherPriorityTaskWoken 
)

Add an item to the front of the queue. This will result in the item being removed first, ahead of all of the items added by the base calss Dequeue() function.

Parameters
itemThe item you are adding.
pxHigherPriorityTaskWokenDid this operation result in a rescheduling event.
Returns
true if the item was added, false if it was not.

Definition at line 186 of file cqueue.cpp.


The documentation for this class was generated from the following files: