45 if (
nullptr != handle) {
51 if (
nullptr == handle || !handle->
create(depth, msgSize)) {
57 #if FW_QUEUE_REGISTRATION
58 if (this->s_queueRegistry) {
59 this->s_queueRegistry->regQueue(
this);
68 if (
nullptr != handle) {
79 bool success = queue.
push(buffer, size, priority);
95 bool success = queue.
push(buffer, size, priority);
113 if (
nullptr == buffer) {
135 bool success = queue.
pop(buffer, size, pri);
147 else if( size == 0 ) {
171 bool success = queue.
pop(buffer, size, pri);
PlatformPointerCastType POINTER_CAST
PlatformIntType NATIVE_INT_TYPE
uint8_t U8
8-bit unsigned integer
PlatformUIntType NATIVE_UINT_TYPE
C++-compatible configuration header for fprime configuration.
bool m_init
Actual queue used to store.
bool create(NATIVE_INT_TYPE depth, NATIVE_INT_TYPE msgSize)
A generic buffer queue data structure.
bool create(NATIVE_UINT_TYPE depth, NATIVE_UINT_TYPE msgSize)
BufferQueue creation.
NATIVE_UINT_TYPE getCount()
Get the current number of items on the queue.
NATIVE_UINT_TYPE getMsgSize()
Get the maximum message size.
bool pop(U8 *buffer, NATIVE_UINT_TYPE &size, NATIVE_INT_TYPE &priority)
pop an item off the queue
NATIVE_UINT_TYPE getDepth()
Get the queue depths.
bool isEmpty()
check if the queue is empty
bool push(const U8 *buffer, NATIVE_UINT_TYPE size, NATIVE_INT_TYPE priority)
push an item onto the queue
bool isFull()
check if the queue is full
NATIVE_UINT_TYPE getMaxCount()
Get the maximum number of items seen on the queue.
NATIVE_INT_TYPE getMsgSize() const
get the message size (maximum message size queue can hold)
@ QUEUE_SIZE_MISMATCH
attempted to send or receive with buffer too large, too small
@ QUEUE_UNINITIALIZED
Queue wasn't initialized successfully.
@ QUEUE_NO_MORE_MSGS
If non-blocking, all the messages have been drained.
@ QUEUE_EMPTY_BUFFER
supplied buffer is empty
@ QUEUE_OK
message sent/received okay
@ QUEUE_FULL
queue was full when attempting to send a message
QueueStatus send(const Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE priority, QueueBlocking block)
send a message
QueueStatus createInternal(const Fw::StringBase &name, NATIVE_INT_TYPE depth, NATIVE_INT_TYPE msgSize)
create a message queue
QueueStatus receive(Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE &priority, QueueBlocking block)
receive a message
NATIVE_INT_TYPE getQueueSize() const
get the queue depth (maximum number of messages queue can hold)
NATIVE_INT_TYPE getMaxMsgs() const
get the maximum number of messages (high watermark)
@ QUEUE_NONBLOCKING
Queue receive always returns even if there is no message.
NATIVE_INT_TYPE getNumMsgs() const
get the number of messages in the queue
POINTER_CAST m_handle
handle for implementation specific queue
Queue::QueueStatus bareReceiveBlock(BareQueueHandle &handle, U8 *buffer, NATIVE_INT_TYPE capacity, NATIVE_INT_TYPE &actualSize, NATIVE_INT_TYPE &priority)
Queue::QueueStatus bareSendNonBlock(BareQueueHandle &handle, const U8 *buffer, NATIVE_INT_TYPE size, NATIVE_INT_TYPE priority)
Queue::QueueStatus bareSendBlock(BareQueueHandle &handle, const U8 *buffer, NATIVE_INT_TYPE size, NATIVE_INT_TYPE priority)
Queue::QueueStatus bareReceiveNonBlock(BareQueueHandle &handle, U8 *buffer, NATIVE_INT_TYPE capacity, NATIVE_INT_TYPE &actualSize, NATIVE_INT_TYPE &priority)