F´ Flight Software - C/C++ Documentation NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
|
A generic buffer queue data structure. More...
#include <Os/Pthreads/BufferQueue.hpp>
Public Member Functions | |
BufferQueue () | |
BufferQueue constructor. | |
~BufferQueue () | |
BufferQueue deconstructor. | |
bool | create (NATIVE_UINT_TYPE depth, NATIVE_UINT_TYPE msgSize) |
BufferQueue creation. | |
bool | push (const U8 *buffer, NATIVE_UINT_TYPE size, NATIVE_INT_TYPE priority) |
push an item onto the queue | |
bool | pop (U8 *buffer, NATIVE_UINT_TYPE &size, NATIVE_INT_TYPE &priority) |
pop an item off the queue | |
bool | isFull () |
check if the queue is full | |
bool | isEmpty () |
check if the queue is empty | |
NATIVE_UINT_TYPE | getCount () |
Get the current number of items on the queue. | |
NATIVE_UINT_TYPE | getMaxCount () |
Get the maximum number of items seen on the queue. | |
NATIVE_UINT_TYPE | getMsgSize () |
Get the maximum message size. | |
NATIVE_UINT_TYPE | getDepth () |
Get the queue depths. | |
A generic buffer queue data structure.
This is a generic queue interface that can be implemented using a variety of different data structures
Definition at line 26 of file BufferQueue.hpp.
Os::BufferQueue::BufferQueue | ( | ) |
BufferQueue constructor.
Create a BufferQueue object.
Definition at line 25 of file BufferQueueCommon.cpp.
Os::BufferQueue::~BufferQueue | ( | ) |
BufferQueue deconstructor.
Deallocate the queue.
Definition at line 34 of file BufferQueueCommon.cpp.
bool Os::BufferQueue::create | ( | NATIVE_UINT_TYPE | depth, |
NATIVE_UINT_TYPE | msgSize | ||
) |
BufferQueue creation.
Create a queue with buffer allocated at initialization. Messages will have a maximum size "msgSize" and the buffer with be "depth" elements deep.
depth | the maximum number of buffers to store on queue |
msgSize | the maximum size of a buffer that can be stored on the queue |
Definition at line 38 of file BufferQueueCommon.cpp.
NATIVE_UINT_TYPE Os::BufferQueue::getCount | ( | ) |
Get the current number of items on the queue.
Get the number of items on the queue.
Definition at line 99 of file BufferQueueCommon.cpp.
NATIVE_UINT_TYPE Os::BufferQueue::getDepth | ( | ) |
Get the queue depths.
Get the maximum number of messages allowed on the queue
Definition at line 112 of file BufferQueueCommon.cpp.
NATIVE_UINT_TYPE Os::BufferQueue::getMaxCount | ( | ) |
Get the maximum number of items seen on the queue.
Get the maximum number of items that have been on the queue since the instantiation of the queue. This is a "high water mark" count.
Definition at line 103 of file BufferQueueCommon.cpp.
NATIVE_UINT_TYPE Os::BufferQueue::getMsgSize | ( | ) |
Get the maximum message size.
Get the maximum message size allowed on the queue
Definition at line 108 of file BufferQueueCommon.cpp.
bool Os::BufferQueue::isEmpty | ( | ) |
check if the queue is empty
Is the queue empty?
Definition at line 95 of file BufferQueueCommon.cpp.
bool Os::BufferQueue::isFull | ( | ) |
bool Os::BufferQueue::pop | ( | U8 * | buffer, |
NATIVE_UINT_TYPE & | size, | ||
NATIVE_INT_TYPE & | priority | ||
) |
pop an item off the queue
Pull an item off of the queue and put it in "buffer" which is of size "size". Returns the size of the pulled item in "size" and the priority of the pulled item in "priority" on a success.
buffer | the buffer to fill from the queue |
size | the size of buffer. The size of the popped buffer will also be returned in this variable. It is used as both input and output |
priority | the priority of the buffer popped off the queue |
Definition at line 72 of file BufferQueueCommon.cpp.
bool Os::BufferQueue::push | ( | const U8 * | buffer, |
NATIVE_UINT_TYPE | size, | ||
NATIVE_INT_TYPE | priority | ||
) |
push an item onto the queue
Push an item onto the queue with the specified size and priority
buffer | the buffer to push onto the queue |
size | the size of buffer |
priority | the priority of the buffer on the queue (higher priority means that the buffer will be popped off sooner. |
Definition at line 51 of file BufferQueueCommon.cpp.