![]() |
F´ Flight Software - C/C++ Documentation
devel
A framework for building embedded system applications to NASA flight quality standards.
|
#include <Os/Queue.hpp>
Public Member Functions | |
Queue () | |
queue constructor More... | |
virtual | ~Queue () |
default queue destructor More... | |
Queue (const Queue &other)=delete | |
copy constructor is forbidden More... | |
Queue (const Queue *other)=delete | |
copy constructor is forbidden More... | |
QueueInterface & | 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 through delegate More... | |
Status | send (const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override |
send a message into the queue through delegate More... | |
Status | receive (U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override |
receive a message from the queue through delegate More... | |
FwSizeType | getMessagesAvailable () const override |
get number of messages available More... | |
FwSizeType | getMessageHighWaterMark () const override |
get maximum messages stored at any given time through delegate More... | |
QueueHandle * | getHandle () override |
return the underlying queue handle (implementation specific). Delegates to implementation. More... | |
Status | send (const Fw::SerializeBufferBase &message, FwQueuePriorityType priority, BlockingType blockType) |
send a message to a queue More... | |
Status | receive (Fw::SerializeBufferBase &destination, BlockingType blockType, FwQueuePriorityType &priority) |
receive a message from a queue More... | |
FwSizeType | getDepth () const |
get the queue's depth in messages More... | |
FwSizeType | getMessageSize () const |
get the queue's message maximum size More... | |
const QueueString & | getName () const |
get the queue's name 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... | |
Static Public Member Functions | |
static FwSizeType | getNumQueues () |
get number of queues system-wide More... | |
static Os::Mutex & | getStaticMutex () |
get static mutex More... | |
![]() | |
static QueueInterface * | getDelegate (QueueHandleStorage &aligned_placement_new_memory) |
provide a pointer to a queue delegate object More... | |
Additional Inherited Members | |
![]() | |
enum | Status { OP_OK , ALREADY_CREATED , EMPTY , UNINITIALIZED , SIZE_MISMATCH , SEND_ERROR , RECEIVE_ERROR , INVALID_PRIORITY , FULL , UNKNOWN_ERROR } |
status returned from the queue send function More... | |
enum | BlockingType { BLOCKING , NONBLOCKING } |
message type More... | |
|
delete |
copy constructor is forbidden
|
delete |
copy constructor is forbidden
|
overridevirtual |
create queue storage through delegate
Creates a queue ensuring sufficient storage to hold depth
messages of messageSize
size each. This method delegates to the underlying implementation. Resource allocation is dependent on the underlying implementation and users should assume that resource allocation is possible.
name | name of queue |
depth | depth of queue in number of messages |
messageSize | size of an individual message |
Implements Os::QueueInterface.
FwSizeType Os::Queue::getDepth | ( | ) | const |
|
overridevirtual |
return the underlying queue handle (implementation specific). Delegates to implementation.
Implements Os::QueueInterface.
|
overridevirtual |
get maximum messages stored at any given time through delegate
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.
|
overridevirtual |
get number of messages available
Returns the number of messages currently available in the queue. This method delegates to the underlying implementation.
Implements Os::QueueInterface.
FwSizeType Os::Queue::getMessageSize | ( | ) | const |
const QueueString & Os::Queue::getName | ( | ) | const |
|
static |
|
static |
|
overridevirtualdelete |
assignment operator is forbidden
Reimplemented from Os::QueueInterface.
Status Os::Queue::receive | ( | Fw::SerializeBufferBase & | destination, |
BlockingType | blockType, | ||
FwQueuePriorityType & | priority | ||
) |
receive a message from a queue
Receive a message from a queue with the given block type. See: QueueInterface::receive. Note: this will entirely overwrite the buffer.
destination | reference to serialize buffer for storing message |
priority | (output) priority of the message |
blockType | BLOCKING to block for space or NONBLOCKING to return error when queue is full |
|
overridevirtual |
receive a message from the queue through delegate
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. This method delegates to the underlying implementation.
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.
Status Os::Queue::send | ( | const Fw::SerializeBufferBase & | message, |
FwQueuePriorityType | priority, | ||
BlockingType | blockType | ||
) |
send a message to a queue
Send a message to a queue with the given priority and block type. See: QueueInterface::send
message | reference to serialize buffer storing message |
priority | priority of the message |
blockType | BLOCKING to block for space or NONBLOCKING to return error when queue is full |
|
overridevirtual |
send a message into the queue through delegate
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. This method delegates to the underlying implementation.
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.