F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
Types::Queue Class Reference

#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
 

Detailed Description

Definition at line 22 of file Queue.hpp.

Constructor & Destructor Documentation

◆ Queue()

Types::Queue::Queue ( )

constructs an uninitialized queue

Definition at line 15 of file Queue.cpp.

Member Function Documentation

◆ clear_high_water_mark()

void Types::Queue::clear_high_water_mark ( )

Clear tracking of the largest allocated size

Definition at line 56 of file Queue.cpp.

◆ dequeue()

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.

Parameters
messagemessage of size m_message_size to dequeue
sizesize of the buffer being supplied.
Returns
: Fw::SERIALIZE_OK on success, something else on failure

Definition at line 38 of file Queue.cpp.

◆ enqueue()

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.

Parameters
messagemessage of size m_message_size to enqueue
sizesize of the message being sent. Must be equivalent to queue's message size.
Returns
: Fw::SERIALIZE_OK on success, something else on failure

Definition at line 29 of file Queue.cpp.

◆ get_high_water_mark()

NATIVE_UINT_TYPE Types::Queue::get_high_water_mark ( ) const

Return the largest tracked allocated size

Definition at line 51 of file Queue.cpp.

◆ getQueueSize()

NATIVE_UINT_TYPE Types::Queue::getQueueSize ( ) const

Definition at line 60 of file Queue.cpp.

◆ setup()

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.

Parameters
storagestorage memory allocation
storage_sizesize of the provided allocation
depthdepth of the queue
message_sizesize of individual messages

Definition at line 17 of file Queue.cpp.


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