12 QueueRegistry* Queue::s_queueRegistry =
nullptr;
25 if (this->m_depth > 0 || this->m_size > 0) {
26 return QueueInterface::Status::ALREADY_CREATED;
31 this->m_depth = depth;
32 this->m_size = messageSize;
34 Queue::s_queueCount++;
35 if (Queue::s_queueRegistry !=
nullptr) {
36 Queue::s_queueRegistry->registerQueue(
this);
49 if (this->m_depth == 0 || this->m_size == 0) {
50 return QueueInterface::Status::UNINITIALIZED;
54 return QueueInterface::Status::SIZE_MISMATCH;
56 return this->m_delegate.
send(buffer, size, priority, blockType);
67 if (this->m_depth == 0 || this->m_size == 0) {
68 return QueueInterface::Status::UNINITIALIZED;
72 return QueueInterface::Status::SIZE_MISMATCH;
74 return this->m_delegate.
receive(destination, capacity, blockType, actualSize, priority);
109 status = QueueInterface::Status::SIZE_MISMATCH;
116 return this->m_depth;
129 return Queue::s_queueCount;
uint8_t U8
8-bit unsigned integer
int PlatformIntType
DefaultTypes.hpp provides fallback defaults for the platform types.
PlatformSizeType FwSizeType
NATIVE_UINT_TYPE SizeType
virtual U8 * getBuffAddr()=0
gets buffer address for data filling
SerializeStatus setBuffLen(Serializable::SizeType length)
sets buffer length manually after filling with data
void resetSer()
reset to beginning of buffer to reuse for serialization
Serializable::SizeType getBuffLength() const
returns current buffer size
virtual Serializable::SizeType getBuffCapacity() const =0
returns capacity, not current size, of buffer
QueueHandle parent class.
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
FwSizeType getMessagesAvailable() const override
get number of messages available
FwSizeType getDepth() const
get the queue's depth in messages
QueueHandle * getHandle() override
return the underlying queue handle (implementation specific). Delegates to implementation.
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
const QueueString & getName() const
get the queue's name
Status create(const Fw::StringBase &name, FwSizeType depth, FwSizeType messageSize) override
create queue storage through delegate
virtual ~Queue()
default queue destructor
static Os::Mutex & getStaticMutex()
get static mutex
static FwSizeType getNumQueues()
get number of queues system-wide
FwSizeType getMessageHighWaterMark() const override
get maximum messages stored at any given time through delegate
FwSizeType getMessageSize() const
get the queue's message maximum size
virtual QueueHandle * getHandle()=0
return the underlying queue handle (implementation specific)
virtual ~QueueInterface()=default
default queue destructor
virtual Status create(const Fw::StringBase &name, FwSizeType depth, FwSizeType messageSize)=0
create queue storage
virtual FwSizeType getMessageHighWaterMark() const =0
get maximum messages stored at any given time
virtual Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority)=0
receive a message from the queue
Status
status returned from the queue send function
virtual Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType)=0
send a message into the queue
virtual FwSizeType getMessagesAvailable() const =0
get number of messages available
QueueInterface()=default
default queue interface constructor
locks a mutex within the current scope
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
@ OP_OK
Operation succeeded.