F´ Flight Software - C/C++ Documentation
devel
A framework for building embedded system applications to NASA flight quality standards.
|
#include <Utils/Types/Queue.hpp>
Public Member Functions | |
Queue () | |
constructs an uninitialized queue More... | |
void | setup (U8 *const storage, const FwSizeType storage_size, const FwSizeType depth, const FwSizeType message_size) |
setup the queue object to setup storage More... | |
Fw::SerializeStatus | enqueue (const U8 *const message, const FwSizeType size) |
pushes a fixed-size message onto the back of the queue More... | |
Fw::SerializeStatus | dequeue (U8 *const message, const FwSizeType size) |
pops a fixed-size message off the front of the queue More... | |
NATIVE_UINT_TYPE | get_high_water_mark () const |
void | clear_high_water_mark () |
NATIVE_UINT_TYPE | getQueueSize () const |
void Types::Queue::clear_high_water_mark | ( | ) |
Fw::SerializeStatus Types::Queue::dequeue | ( | U8 *const | message, |
const FwSizeType | size | ||
) |
pops a fixed-size message off the front of the queue
Pops a fixed-size message off the front of the queue. This performs a copy of the data into the provided message buffer. Note: message is required to be of the size message_size as defined by the construction of the queue. The size must be greater or equal to message size, although only message size bytes will be used.
This will return a non-Fw::SERIALIZE_OK status when the queue is empty.
message | message of size m_message_size to dequeue |
size | size of the buffer being supplied. |
Fw::SerializeStatus Types::Queue::enqueue | ( | const U8 *const | message, |
const FwSizeType | size | ||
) |
pushes a fixed-size message onto the back of the queue
Pushes a fixed-size message onto the queue. This performs a copy of the data onto the queue so the user is free to dispose the message data as soon as the call returns. Note: message is required to be of the size message_size as defined by the construction of the queue. Size is provided as a safety check to ensure the sent size is consistent with the expected size of the queue.
This will return a non-Fw::SERIALIZE_OK status when the queue is full.
message | message of size m_message_size to enqueue |
size | size of the message being sent. Must be equivalent to queue's message size. |
NATIVE_UINT_TYPE Types::Queue::get_high_water_mark | ( | ) | const |
NATIVE_UINT_TYPE Types::Queue::getQueueSize | ( | ) | const |
void Types::Queue::setup | ( | U8 *const | storage, |
const FwSizeType | storage_size, | ||
const FwSizeType | depth, | ||
const FwSizeType | message_size | ||
) |
setup the queue object to setup storage
The queue must be configured before use to setup storage parameters. This function supplies those parameters including depth, and message size. Storage size must be greater than or equal to the depth x message size.
storage | storage memory allocation |
storage_size | size of the provided allocation |
depth | depth of the queue |
message_size | size of individual messages |