37 #include "qs_dummy.hpp"
43Q_DEFINE_THIS_MODULE(
"qf_actq")
51 std::uint_fast16_t
const margin,
52 void const *
const sender)
noexcept
57 return static_cast<QActiveDummy *
>(
this)->fakePost(e, margin, sender);
70 bool status = (nFree > 0U);
76 status = (nFree >
static_cast<QEQueueCtr>(margin));
79#if (QF_MAX_EPOOL > 0U)
80 if (e->poolNum_ != 0U) {
117#if (QF_MAX_EPOOL > 0U)
147 if (e->poolNum_ != 0U) {
180 if (frontEvt !=
nullptr) {
262 QEvt const *
const e,
263 void const *
const sender)
288 if (
m_eQueue.m_frontEvt ==
nullptr) {
293 QXTHREAD_EQUEUE_SIGNAL_(
this);
323 std::uint16_t nUse = 0U;
360 std::uint16_t
const nFree =
361 static_cast<std::uint16_t
>(a->
m_eQueue.m_nFree);
380 std::uint16_t
const nMin =
static_cast<std::uint16_t
>(a->
m_eQueue.m_nMin);
388#if (QF_MAX_TICK_RATE > 0U)
400 void const *
const e,
401 std::uint_fast8_t
const qsId)
419 QEvt const *
const e,
420 std::uint_fast8_t
const qsId)
441 for (; nTicks > 0U; --nTicks) {
453 static constexpr QEvt tickEvt(0U);
void fakePostLIFO(QEvt const *const e) noexcept
friend class QActiveDummy
static std::uint16_t getQueueMin(std::uint_fast8_t const prio) noexcept
void postFIFO_(QEvt const *const e, void const *const sender)
bool postx_(QEvt const *const e, std::uint_fast16_t const margin, void const *const sender) noexcept
Posts an event e directly to the event queue of the active object using the First-In-First-Out (FIFO)...
QActive(QStateHandler const initial) noexcept
QActive constructor (abstract base class).
QACTIVE_EQUEUE_TYPE m_eQueue
Port-dependent event-queue type (often QP::QEQueue).
QEvt const * get_() noexcept
Get an event from the event queue of an active object.
void postLIFO(QEvt const *const e) noexcept
Posts an event e directly to the event queue of the active object using the Last-In-First-Out (LIFO) ...
static std::uint16_t getQueueUse(std::uint_fast8_t const prio) noexcept
static std::uint16_t getQueueFree(std::uint_fast8_t const prio) noexcept
std::uint8_t m_prio
QF-priority [1..QF_MAX_ACTIVE] of this AO.
QAsmAttr m_temp
Temporary storage for target/act-table etc.
QAsmAttr m_state
Current state (pointer to the current state-handler function).
std::uint32_t poolNum_
Event pool number of this event.
std::uint32_t refCtr_
Event reference counter.
std::uint32_t sig
Signal of the event (see Event Signal).
static void onTestPost(void const *sender, QActive *recipient, QEvt const *e, bool status)
void trig_(void const *const sender) noexcept
Asynchronously trigger the QTicker active object to perform tick processing.
void dispatch(QEvt const *const e, std::uint_fast8_t const qsId) override
Virtual function to dispatch an event to the state machine.
static void tick(std::uint_fast8_t const tickRate, void const *const sender) noexcept
Processes all armed time events at every clock tick.
void gc(QEvt const *const e) noexcept
Recycle a mutable (mutable) event.
constexpr std::uint_fast16_t NO_MARGIN
Special value of margin that causes asserting failure in case event allocation or event posting fails...
QP/C++ Framework namespace.
@ QS_QF_ACTIVE_GET_LAST
AO got an event and its queue is empty.
@ QS_QF_ACTIVE_POST_ATTEMPT
attempt to post an evt to AO failed
@ QS_QF_ACTIVE_POST_LIFO
an event was posted (LIFO) directly to AO
@ QS_QF_ACTIVE_GET
AO got an event and its queue is not empty.
@ QS_QF_ACTIVE_POST
an event was posted (FIFO) directly to AO
void QEvt_refCtr_inc_(QEvt const *const me) noexcept
Internal function to increment the refCtr of a const event.
std::uint16_t QEQueueCtr
The data type to store the ring-buffer counters.
std::array< QActive *, QF_MAX_ACTIVE+1U > QActive_registry_
Internal array of pointers to the registered Active Objects.
#define Q_UNUSED_PAR(par_)
Helper macro to clearly mark unused parameters of functions.
#define Q_STATE_CAST(handler_)
Perform cast to QP::QStateHandler.
#define QF_MAX_ACTIVE
Maximum # Active Objects in the system (1..64).
QP Framework in C++ internal (package-scope) interface
#define QACTIVE_EQUEUE_SIGNAL_(me_)
#define QACTIVE_EQUEUE_WAIT_(me_)
#define QS_LOC_CHECK_(qsId_)
QS (QP/Spy software tracing) internal (package-scope) interface.
#define QS_OBJ_PRE(obj_)
Output pre-formatted object pointer element.
#define QS_EQC_PRE(ctr_)
Output pre-formatted event queue counter data element.
#define QS_SIG_PRE(sig_)
Output pre-formatted event signal data element.
#define QS_2U8_PRE(data1_, data2_)
Output two pre-formatted unsigned 8-bit integer data elements.
#define QS_END_PRE()
Pre-formatted QS trace record end.
#define QS_BEGIN_PRE(rec_, qsId_)
Pre-formatted QS trace record begin.
QP Functional Safety (FuSa) Subsystem.
#define Q_ASSERT_INCRIT(id_, expr_)
General-purpose assertion with user-specified ID number (in critical section).
#define Q_REQUIRE_INCRIT(id_, expr_)
Assertion for checking a precondition (in critical section).