30 (void)::memcpy(this->
m_data + offset, data, static_cast<size_t>(size));
38 (void)::memcpy(destination, this->
m_data + offset, static_cast<size_t>(size));
55 if (indices ==
nullptr) {
56 return QueueInterface::Status::UNKNOWN_ERROR;
60 if (sizes ==
nullptr) {
62 return QueueInterface::Status::UNKNOWN_ERROR;
65 U8* data =
new (std::nothrow)
U8[depth * messageSize];
66 if (data ==
nullptr) {
69 return QueueInterface::Status::UNKNOWN_ERROR;
77 return QueueInterface::Status::UNKNOWN_ERROR;
103 return QueueInterface::Status::SIZE_MISMATCH;
109 return QueueInterface::Status::FULL;
135 return QueueInterface::Status::EMPTY;
void notify() override
notify a single waiter on this condition variable
FwSizeType * m_sizes
Size store for each method.
PlatformSizeType FwSizeType
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue
Status
status returned from the queue send function
FwSizeType * m_indices
List of indices into data.
QueueHandle parent class.
bool pop(FwQueuePriorityType &value, FwSizeType &id)
Pop an item from the heap.
U8 * m_data
Pointer to data allocation.
FwSizeType m_stopIndex
End index of the circular data structure.
FwSizeType m_startIndex
Start index of the circular data structure.
FwSizeType m_maxSize
Maximum size allowed of a message.
FwSizeType m_depth
Depth of the queue.
Status create(const Fw::StringBase &name, FwSizeType depth, FwSizeType messageSize) override
create queue storage
FwSizeType m_highMark
Message count high water mark.
QueueHandle * getHandle() override
return the underlying queue handle (implementation specific)
FwSizeType getMessageHighWaterMark() const override
get maximum messages stored at any given time
void store_data(FwSizeType index, const U8 *source, FwSizeType size)
store data into a set index in the data store
bool isEmpty()
Is the heap empty?
bool push(FwQueuePriorityType value, FwSizeType id)
Push an item onto the heap.
#define FW_MAX(a, b)
MAX macro.
bool isFull()
Is the heap full?
Os::ConditionVariable m_empty
Queue empty condition variable to support blocking.
FwSizeType find_index()
find an available index to store data from the list
FwSizeType getSize() const
Get the current number of elements on the heap.
uint8_t U8
8-bit unsigned integer
Os::ConditionVariable m_full
Queue full condition variable to support blocking.
void load_data(FwSizeType index, U8 *destination, FwSizeType capacity)
load data from a set index in the data store
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
bool create(FwSizeType capacity)
MaxHeap creation.
void wait(Os::Mutex &mutex)
wait on a condition variable
locks a mutex within the current scope
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue
Os::Mutex m_data_lock
Lock against data manipulation.
void return_index(FwSizeType index)
return index to the circular data structure
virtual ~PriorityQueue()
default queue destructor
Types::MaxHeap m_heap
MaxHeap data store for tracking priority.
FwSizeType getMessagesAvailable() const override
get number of messages available
PriorityQueueHandle m_handle