12 QueueRegistry* Queue::s_queueRegistry =
nullptr;
21 FW_ASSERT(&this->m_delegate == reinterpret_cast<QueueInterface*>(&this->m_handle_storage[0]));
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);
46 FW_ASSERT(&this->m_delegate == reinterpret_cast<QueueInterface*>(&this->m_handle_storage[0]));
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);
64 FW_ASSERT(&this->m_delegate == reinterpret_cast<QueueInterface*>(&this->m_handle_storage[0]));
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);
78 FW_ASSERT(&this->m_delegate == reinterpret_cast<const QueueInterface*>(&this->m_handle_storage[0]));
83 FW_ASSERT(&this->m_delegate == reinterpret_cast<const QueueInterface*>(&this->m_handle_storage[0]));
88 FW_ASSERT(&this->m_delegate == reinterpret_cast<const QueueInterface*>(&this->m_handle_storage[0]));
107 destination.
setBuffLen(static_cast<Fw::Serializable::SizeType>(actualSize));
109 status = QueueInterface::Status::SIZE_MISMATCH;
116 return this->m_depth;
129 return Queue::s_queueCount;
Serialization/Deserialization operation was successful.
void resetSer()
reset to beginning of buffer to reuse for serialization
Status
status returned from the queue send function
QueueHandle parent class.
static FwSizeType getNumQueues()
get number of queues system-wide
PlatformSizeType FwSizeType
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 ~QueueInterface()=default
default queue destructor
virtual ~Queue()
default queue destructor
SerializeStatus
forward declaration for string
int PlatformIntType
DefaultTypes.hpp provides fallback defaults for the platform types.
virtual FwSizeType getMessagesAvailable() const =0
get number of messages available
Serializable::SizeType getBuffLength() const
returns current buffer size
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
virtual Status create(const Fw::StringBase &name, FwSizeType depth, FwSizeType messageSize)=0
create queue storage
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
uint8_t U8
8-bit unsigned integer
static Os::Mutex & getStaticMutex()
get static mutex
FwSizeType getMessagesAvailable() const override
get number of messages available
Status create(const Fw::StringBase &name, FwSizeType depth, FwSizeType messageSize) override
create queue storage through delegate
virtual Serializable::SizeType getBuffCapacity() const =0
returns capacity, not current size, of buffer
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
virtual Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType)=0
send a message into the queue
virtual U8 * getBuffAddr()=0
gets buffer address for data filling
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
SerializeStatus setBuffLen(Serializable::SizeType length)
sets buffer length manually after filling with data