32#ifndef QF_EQUEUE_CTR_SIZE
33 #define QF_EQUEUE_CTR_SIZE 1U
38#if (QF_EQUEUE_CTR_SIZE == 1U)
40#elif (QF_EQUEUE_CTR_SIZE == 2U)
43 #error QF_EQUEUE_CTR_SIZE defined incorrectly, expected 1U or 2U
57 QEvt const * *
const qSto,
58 std::uint_fast16_t
const qLen)
noexcept;
61 std::uint_fast16_t
const margin,
62 std::uint_fast8_t
const qsId)
noexcept;
65 std::uint_fast8_t
const qsId)
noexcept;
66 QEvt const *
get(std::uint_fast8_t
const qsId)
noexcept;
67 std::uint16_t
getFree()
const noexcept;
68 std::uint16_t
getUse()
const noexcept;
69 std::uint16_t
getMin()
const noexcept;
87 void const *
const sender);
std::uint16_t getUse() const noexcept
Obtain the number of entries in use in the queue.
QEQueueCtr m_nFree
Number of free events in the ring buffer.
QEQueue() noexcept
Default constructor of QP::QEQueue.
void postFIFO_(QEvt const *const e, void const *const sender)
QEvt const * get(std::uint_fast8_t const qsId) noexcept
Obtain an event from the "raw" thread-safe queue.
QEvt const * peekFront() const &
bool isEmpty() const noexcept
Find out if the queue is empty.
QEvt const ** m_ring
Pointer to the start of the ring buffer.
void init(QEvt const **const qSto, std::uint_fast16_t const qLen) noexcept
Initialize the native QF event queue.
QEQueueCtr m_nMin
Minimum number of free events ever in the ring buffer.
std::uint16_t getMin() const noexcept
Obtain the minimum number of free entries ever in the queue (a.k.a. "low-watermark").
bool post(QEvt const *const e, std::uint_fast16_t const margin, std::uint_fast8_t const qsId) noexcept
Post an event to the "raw" thread-safe event queue (FIFO).
QEvt const * m_frontEvt
Pointer to event at the front of the queue.
QEQueueCtr m_head
Offset to where next event will be inserted into the buffer.
std::uint16_t getFree() const noexcept
Obtain the number of free entries still available in the queue.
QEvt const * peekFront() &&=delete
QEQueueCtr m_end
Offset of the end of the ring buffer from the start of the buffer.
void postLIFO(QEvt const *const e, std::uint_fast8_t const qsId) noexcept
Post an event to the "raw" thread-safe event queue (LIFO).
QEQueueCtr m_tail
Offset of where next event will be extracted from the buffer.
QP/C++ Framework namespace.
std::uint16_t QEQueueCtr
The data type to store the ring-buffer counters.