12 #if FW_QUEUE_REGISTRATION 13 QueueRegistry* Queue::s_queueRegistry =
nullptr;
23 FW_ASSERT(&this->m_delegate == reinterpret_cast<QueueInterface*>(&this->m_handle_storage[0]));
27 if (this->m_depth > 0 || this->m_size > 0) {
28 return QueueInterface::Status::ALREADY_CREATED;
33 this->m_depth = depth;
34 this->m_size = messageSize;
36 Queue::s_queueCount++;
37 #if FW_QUEUE_REGISTRATION 38 if (Queue::s_queueRegistry !=
nullptr) {
39 Queue::s_queueRegistry->registerQueue(
this);
50 FW_ASSERT(&this->m_delegate == reinterpret_cast<QueueInterface*>(&this->m_handle_storage[0]));
53 if (this->m_depth == 0 || this->m_size == 0) {
54 return QueueInterface::Status::UNINITIALIZED;
58 return QueueInterface::Status::SIZE_MISMATCH;
60 return this->m_delegate.
send(buffer, size, priority, blockType);
68 FW_ASSERT(&this->m_delegate == reinterpret_cast<QueueInterface*>(&this->m_handle_storage[0]));
71 if (this->m_depth == 0 || this->m_size == 0) {
72 return QueueInterface::Status::UNINITIALIZED;
76 return QueueInterface::Status::SIZE_MISMATCH;
78 return this->m_delegate.
receive(destination, capacity, blockType, actualSize, priority);
82 FW_ASSERT(&this->m_delegate == reinterpret_cast<const QueueInterface*>(&this->m_handle_storage[0]));
87 FW_ASSERT(&this->m_delegate == reinterpret_cast<const QueueInterface*>(&this->m_handle_storage[0]));
92 FW_ASSERT(&this->m_delegate == reinterpret_cast<const QueueInterface*>(&this->m_handle_storage[0]));
111 destination.
setBuffLen(static_cast<Fw::Serializable::SizeType>(actualSize));
113 status = QueueInterface::Status::SIZE_MISMATCH;
120 return this->m_depth;
133 return Queue::s_queueCount;
Serialization/Deserialization operation was successful.
PlatformSizeType FwSizeType
void resetSer()
reset to beginning of buffer to reuse for serialization
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
QueueHandle parent class.
static FwSizeType getNumQueues()
get number of queues system-wide
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
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
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
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
SerializeStatus setBuffLen(Serializable::SizeType length)
sets buffer length manually after filling with data