12 #if FW_QUEUE_REGISTRATION 13 QueueRegistry* Queue::s_queueRegistry =
nullptr;
26 FW_ASSERT(&this->m_delegate == reinterpret_cast<QueueInterface*>(&this->m_handle_storage[0]));
30 if (this->m_depth > 0 || this->m_size > 0) {
31 return QueueInterface::Status::ALREADY_CREATED;
36 this->m_depth = depth;
37 this->m_size = messageSize;
39 Queue::s_queueCount++;
40 #if FW_QUEUE_REGISTRATION 41 if (Queue::s_queueRegistry !=
nullptr) {
42 Queue::s_queueRegistry->registerQueue(
this);
50 FW_ASSERT(&this->m_delegate == reinterpret_cast<QueueInterface*>(&this->m_handle_storage[0]));
58 FW_ASSERT(&this->m_delegate == reinterpret_cast<QueueInterface*>(&this->m_handle_storage[0]));
61 if (this->m_depth == 0 || this->m_size == 0) {
62 return QueueInterface::Status::UNINITIALIZED;
66 return QueueInterface::Status::SIZE_MISMATCH;
68 return this->m_delegate.
send(buffer, size, priority, blockType);
76 FW_ASSERT(&this->m_delegate == reinterpret_cast<QueueInterface*>(&this->m_handle_storage[0]));
79 if (this->m_depth == 0 || this->m_size == 0) {
80 return QueueInterface::Status::UNINITIALIZED;
84 return QueueInterface::Status::SIZE_MISMATCH;
86 return this->m_delegate.
receive(destination, capacity, blockType, actualSize, priority);
90 FW_ASSERT(&this->m_delegate == reinterpret_cast<const QueueInterface*>(&this->m_handle_storage[0]));
95 FW_ASSERT(&this->m_delegate == reinterpret_cast<const QueueInterface*>(&this->m_handle_storage[0]));
100 FW_ASSERT(&this->m_delegate == reinterpret_cast<const QueueInterface*>(&this->m_handle_storage[0]));
119 destination.
setBuffLen(static_cast<Fw::Serializable::SizeType>(actualSize));
121 status = QueueInterface::Status::SIZE_MISMATCH;
128 return this->m_depth;
141 return Queue::s_queueCount;
Serialization/Deserialization operation was successful.
Status create(FwEnumStoreType id, const Fw::ConstStringBase &name, FwSizeType depth, FwSizeType messageSize) override
create queue storage through delegate
PlatformSizeType FwSizeType
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Status
status returned from the queue send function
Serializable::SizeType getSize() const override
Get current buffer size.
QueueHandle parent class.
static FwSizeType getNumQueues()
get number of queues system-wide
virtual U8 * getBuffAddr()=0
Get buffer address for data filling (non-const version)
virtual Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority)=0
receive a message from the queue
FwSizeType getDepth() const
get the queue's depth in messages
virtual void teardown()
teardown the queue
virtual ~QueueInterface()=default
default queue destructor
virtual ~Queue()
default queue destructor
SerializeStatus
forward declaration for string
virtual FwSizeType getMessagesAvailable() const =0
get number of messages available
virtual Status create(FwEnumStoreType id, const Fw::ConstStringBase &name, FwSizeType depth, FwSizeType messageSize)=0
create queue storage
QueueHandle * getHandle() override
return the underlying queue handle (implementation specific). Delegates to implementation.
virtual QueueHandle * getHandle()=0
return the underlying queue handle (implementation specific)
const QueueString & getName() const
get the queue's name
FwSizeType getMessageSize() const
get the queue's message maximum size
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
void resetSer() override
Reset serialization pointer to beginning of buffer.
Serializable::SizeType getCapacity() const override=0
Get buffer capacity.
void teardown() override
teardown the queue
uint8_t U8
8-bit unsigned integer
static Os::Mutex & getStaticMutex()
get static mutex
FwSizeType getMessagesAvailable() const override
get number of messages available
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
A read-only abstract superclass for StringBase.
locks a mutex within the current scope
virtual FwSizeType getMessageHighWaterMark() const =0
get maximum messages stored at any given time
FwSizeType getMessageHighWaterMark() const override
get maximum messages stored at any given time through delegate
SerializeStatus setBuffLen(Serializable::SizeType length) override
Set buffer length manually.
virtual Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType)=0
send a message into the queue
U8 * getBuffAddrSer()
Get address of end of serialization (DANGEROUS!)