7 #ifndef Fw_ExternalFifoQueue_HPP 8 #define Fw_ExternalFifoQueue_HPP 23 template <
typename TT>
64 this->m_items = queue.m_items;
65 this->m_enqueueIndex = queue.m_enqueueIndex;
66 this->m_dequeueIndex = queue.m_dequeueIndex;
67 this->m_size = queue.m_size;
83 this->m_items.setStorage(items, capacity);
95 this->m_items.setStorage(data, capacity);
109 const auto i = this->m_enqueueIndex.
getValue();
110 this->m_items[i] = e;
124 FW_ASSERT(index < this->m_size, static_cast<FwAssertArgType>(index),
125 static_cast<FwAssertArgType>(this->m_size));
126 auto ci = this->m_dequeueIndex;
128 return this->m_items[i];
136 if (this->m_size > 0) {
179 CircularIndex m_enqueueIndex = {};
182 CircularIndex m_dequeueIndex = {};
PlatformSizeType FwSizeType
ExternalFifoQueue< T > & operator=(const ExternalFifoQueue< T > &queue)
operator=
FwSizeType getCapacity() const override
FwSizeType getValue() const
friend class ExternalFifoQueueTester
ExternalFifoQueue(T *items, FwSizeType capacity)
Constructor providing typed backing storage.
ExternalFifoQueue(const ExternalFifoQueue< T > &queue)
Copy constructor.
FwSizeType increment(FwSizeType amount=1)
ExternalFifoQueue()=default
Zero-argument constructor.
void setStorage(T *items, FwSizeType capacity)
Set the storage (typed data)
void setModulus(FwSizeType modulus)
Set the modulus.
static constexpr FwSizeType getByteArraySize(FwSizeType capacity)
~ExternalFifoQueue() override=default
Destructor.
FwSizeType getSize() const override
Success enqueue(const T &e) override
ExternalFifoQueue(ByteArray data, FwSizeType capacity)
Constructor providing untyped backing storage.
A variable-length byte array.
uint8_t U8
8-bit unsigned integer
void setValue(FwSizeType value)
Set the index value.
Success dequeue(T &e) override
void clear() override
Clear the queue.
void setStorage(ByteArray data, FwSizeType capacity)
Set the storage (untyped data)
static constexpr U8 getByteArrayAlignment()
static constexpr FwSizeType getByteArraySize(FwSizeType size)
static constexpr U8 getByteArrayAlignment()
const T & at(FwSizeType index) const override