![]() |
F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
|
generic priority queue implementation More...
#include <Os/Generic/PriorityQueue.hpp>
Public Member Functions | |
PriorityQueue ()=default | |
default queue interface constructor More... | |
virtual | ~PriorityQueue () |
default queue destructor More... | |
PriorityQueue (const QueueInterface &other)=delete | |
copy constructor is forbidden More... | |
PriorityQueue (const QueueInterface *other)=delete | |
copy constructor is forbidden More... | |
PriorityQueue & | operator= (const QueueInterface &other) override=delete |
assignment operator is forbidden More... | |
Status | create (const Fw::StringBase &name, FwSizeType depth, FwSizeType messageSize) override |
create queue storage More... | |
Status | send (const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override |
send a message into the queue More... | |
Status | receive (U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override |
receive a message from the queue More... | |
FwSizeType | getMessagesAvailable () const override |
get number of messages available More... | |
FwSizeType | getMessageHighWaterMark () const override |
get maximum messages stored at any given time More... | |
QueueHandle * | getHandle () override |
return the underlying queue handle (implementation specific) More... | |
![]() | |
QueueInterface ()=default | |
default queue interface constructor More... | |
virtual | ~QueueInterface ()=default |
default queue destructor More... | |
QueueInterface (const QueueInterface &other)=delete | |
copy constructor is forbidden More... | |
QueueInterface (const QueueInterface *other)=delete | |
copy constructor is forbidden More... | |
Public Attributes | |
PriorityQueueHandle | m_handle |
Additional Inherited Members | |
![]() | |
enum | Status { OP_OK, ALREADY_CREATED, EMPTY, UNINITIALIZED, SIZE_MISMATCH, SEND_ERROR, RECEIVE_ERROR, INVALID_PRIORITY, FULL, NOT_SUPPORTED, UNKNOWN_ERROR } |
status returned from the queue send function More... | |
enum | BlockingType { BLOCKING, NONBLOCKING } |
message type More... | |
![]() | |
static QueueInterface * | getDelegate (QueueHandleStorage &aligned_placement_new_memory) |
provide a pointer to a queue delegate object More... | |
generic priority queue implementation
A generic implementation of a priority queue to support the Os::QueueInterface. This queue uses OSAL mutexes, and condition variables to provide for a task-safe blocking queue implementation. Data is stored in heap memory.
Definition at line 56 of file PriorityQueue.hpp.
|
default |
default queue interface constructor
|
virtual |
default queue destructor
Definition at line 41 of file PriorityQueue.cpp.
|
delete |
copy constructor is forbidden
|
delete |
copy constructor is forbidden
|
overridevirtual |
create queue storage
Creates a queue ensuring sufficient storage to hold depth
messages of messageSize
size each.
name | name of queue |
depth | depth of queue in number of messages |
messageSize | size of an individual message |
Implements Os::QueueInterface.
Definition at line 47 of file PriorityQueue.cpp.
|
overridevirtual |
return the underlying queue handle (implementation specific)
Implements Os::QueueInterface.
Definition at line 164 of file PriorityQueue.cpp.
|
overridevirtual |
get maximum messages stored at any given time
Returns the maximum number of messages in this queue at any given time. This is the high-water mark for this queue.
Implements Os::QueueInterface.
Definition at line 158 of file PriorityQueue.cpp.
|
overridevirtual |
get number of messages available
Implements Os::QueueInterface.
Definition at line 154 of file PriorityQueue.cpp.
|
overridevirtualdelete |
assignment operator is forbidden
Reimplemented from Os::QueueInterface.
|
overridevirtual |
receive a message from the queue
Receive a message from the queue, providing the message destination, capacity, priority, and blocking type. When blockType
is set to BLOCKING, this call will block on queue empty. Otherwise, this will return an error status on queue empty. Actual size received and priority of message is set on success status.
destination | destination for message data |
capacity | maximum size of message data |
blockType | BLOCKING to wait for message or NONBLOCKING to return error when queue is empty |
actualSize | (output) actual size of message read |
priority | (output) priority of message read |
Implements Os::QueueInterface.
Definition at line 127 of file PriorityQueue.cpp.
|
overridevirtual |
send a message into the queue
Send a message into the queue, providing the message data, size, priority, and blocking type. When blockType
is set to BLOCKING, this call will block on queue full. Otherwise, this will return an error status on queue full.
buffer | message data |
size | size of message data |
priority | priority of the message |
blockType | BLOCKING to block for space or NONBLOCKING to return error when queue is full |
Implements Os::QueueInterface.
Definition at line 97 of file PriorityQueue.cpp.
PriorityQueueHandle Os::Generic::PriorityQueue::m_handle |
Definition at line 139 of file PriorityQueue.hpp.