F´ Flight Software - C/C++ Documentation NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
|
#include <Os/Queue.hpp>
Public Types | |
enum | QueueStatus { QUEUE_OK , QUEUE_NO_MORE_MSGS , QUEUE_UNINITIALIZED , QUEUE_SIZE_MISMATCH , QUEUE_SEND_ERROR , QUEUE_RECEIVE_ERROR , QUEUE_INVALID_PRIORITY , QUEUE_EMPTY_BUFFER , QUEUE_FULL , QUEUE_UNKNOWN_ERROR } |
enum | QueueBlocking { QUEUE_BLOCKING , QUEUE_NONBLOCKING } |
Public Member Functions | |
Queue () | |
virtual | ~Queue () |
QueueStatus | create (const Fw::StringBase &name, NATIVE_INT_TYPE depth, NATIVE_INT_TYPE msgSize) |
create a message queue | |
QueueStatus | send (const Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE priority, QueueBlocking block) |
send a message | |
QueueStatus | receive (Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE &priority, QueueBlocking block) |
receive a message | |
QueueStatus | send (const U8 *buffer, NATIVE_INT_TYPE size, NATIVE_INT_TYPE priority, QueueBlocking block) |
send a message | |
QueueStatus | receive (U8 *buffer, NATIVE_INT_TYPE capacity, NATIVE_INT_TYPE &actualSize, NATIVE_INT_TYPE &priority, QueueBlocking block) |
receive a message | |
NATIVE_INT_TYPE | getNumMsgs () const |
get the number of messages in the queue | |
NATIVE_INT_TYPE | getMaxMsgs () const |
get the maximum number of messages (high watermark) | |
NATIVE_INT_TYPE | getQueueSize () const |
get the queue depth (maximum number of messages queue can hold) | |
NATIVE_INT_TYPE | getMsgSize () const |
get the message size (maximum message size queue can hold) | |
const QueueString & | getName () |
get the queue name | |
Static Public Member Functions | |
static NATIVE_INT_TYPE | getNumQueues () |
get the number of queues in the system | |
Protected Member Functions | |
QueueStatus | createInternal (const Fw::StringBase &name, NATIVE_INT_TYPE depth, NATIVE_INT_TYPE msgSize) |
create a message queue | |
Protected Attributes | |
POINTER_CAST | m_handle |
handle for implementation specific queue | |
QueueString | m_name |
queue name | |
Static Protected Attributes | |
static NATIVE_INT_TYPE | s_numQueues = 0 |
tracks number of queues in the system | |
Enumerator | |
---|---|
QUEUE_OK | message sent/received okay |
QUEUE_NO_MORE_MSGS | If non-blocking, all the messages have been drained. |
QUEUE_UNINITIALIZED | Queue wasn't initialized successfully. |
QUEUE_SIZE_MISMATCH | attempted to send or receive with buffer too large, too small |
QUEUE_SEND_ERROR | message send error |
QUEUE_RECEIVE_ERROR | message receive error |
QUEUE_INVALID_PRIORITY | invalid priority requested |
QUEUE_EMPTY_BUFFER | supplied buffer is empty |
QUEUE_FULL | queue was full when attempting to send a message |
QUEUE_UNKNOWN_ERROR | Unexpected error; can't match with returns. |
Queue::QueueStatus Os::Queue::create | ( | const Fw::StringBase & | name, |
NATIVE_INT_TYPE | depth, | ||
NATIVE_INT_TYPE | msgSize | ||
) |
create a message queue
Definition at line 41 of file QueueCommon.cpp.
|
protected |
create a message queue
Internal method used for creating allowing alternate implementations to implement different creation behavior without needing to duplicate the majority of the creation functionality.
name | name of queue |
depth | depth of queue |
msgSize | size of a message stored on queue |
NATIVE_INT_TYPE Os::Queue::getMaxMsgs | ( | ) | const |
NATIVE_INT_TYPE Os::Queue::getMsgSize | ( | ) | const |
const QueueString & Os::Queue::getName | ( | ) |
get the queue name
Definition at line 61 of file QueueCommon.cpp.
NATIVE_INT_TYPE Os::Queue::getNumMsgs | ( | ) | const |
|
static |
get the number of queues in the system
Definition at line 57 of file QueueCommon.cpp.
NATIVE_INT_TYPE Os::Queue::getQueueSize | ( | ) | const |
Queue::QueueStatus Os::Queue::receive | ( | Fw::SerializeBufferBase & | buffer, |
NATIVE_INT_TYPE & | priority, | ||
QueueBlocking | block | ||
) |
receive a message
Definition at line 22 of file QueueCommon.cpp.
Queue::QueueStatus Os::Queue::receive | ( | U8 * | buffer, |
NATIVE_INT_TYPE | capacity, | ||
NATIVE_INT_TYPE & | actualSize, | ||
NATIVE_INT_TYPE & | priority, | ||
QueueBlocking | block | ||
) |
Queue::QueueStatus Os::Queue::send | ( | const Fw::SerializeBufferBase & | buffer, |
NATIVE_INT_TYPE | priority, | ||
QueueBlocking | block | ||
) |
send a message
Definition at line 13 of file QueueCommon.cpp.
Queue::QueueStatus Os::Queue::send | ( | const U8 * | buffer, |
NATIVE_INT_TYPE | size, | ||
NATIVE_INT_TYPE | priority, | ||
QueueBlocking | block | ||
) |
|
protected |
|
protected |
|
staticprotected |