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);
77#if (QF_MAX_EPOOL > 0U)
78 if (e->poolNum_ != 0U) {
87 if (QS_LOC_CHECK_(
m_prio)) {
88 QS::onTestPost(sender,
this, e,
true);
106 if (QS_LOC_CHECK_(
m_prio)) {
107 QS::onTestPost(sender,
this, e, status);
111#if (QF_MAX_EPOOL > 0U)
124 static_cast<QActiveDummy *
>(
this)->QActiveDummy::fakePostLIFO(e);
141 if (e->poolNum_ != 0U) {
164 if (QS_LOC_CHECK_(
m_prio)) {
166 QS::onTestPost(
nullptr,
this, e,
true);
174 if (frontEvt !=
nullptr) {
184 QACTIVE_EQUEUE_SIGNAL_(
this);
197 QACTIVE_EQUEUE_WAIT_(
this);
255void QActive::postFIFO_(
256 QEvt const *
const e,
257 void const *
const sender)
282 if (
m_eQueue.m_frontEvt.e ==
nullptr) {
287 QXTHREAD_EQUEUE_SIGNAL_(this);
290 QACTIVE_EQUEUE_SIGNAL_(this);
293 QACTIVE_EQUEUE_SIGNAL_(
this);
310std::uint16_t QActive::getQueueUse(std::uint_fast8_t
const prio)
noexcept {
317 std::uint16_t nUse = 0U;
325 nUse = a->m_eQueue.getUse();
332 nUse += a->m_eQueue.getUse();
343std::uint16_t QActive::getQueueFree(std::uint_fast8_t
const prio)
noexcept {
354 std::uint16_t
const nFree =
355 static_cast<std::uint16_t
>(a->m_eQueue.m_nFree);
362std::uint16_t QActive::getQueueMin(std::uint_fast8_t
const prio)
noexcept {
374 std::uint16_t
const nMin =
static_cast<std::uint16_t
>(a->m_eQueue.m_nMin);
382#if (QF_MAX_TICK_RATE > 0U)
394 void const *
const e,
395 std::uint_fast8_t
const qsId)
413 QEvt const *
const e,
414 std::uint_fast8_t
const qsId)
435 for (; nTicks > 0U; --nTicks) {
447 static constexpr QEvt tickEvt(0U);
461 QACTIVE_EQUEUE_SIGNAL_(
this);
Active Object class (based on the QP::QHsm implementation strategy).
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) ...
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) \clearpage .
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).
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
Dispatch an event to QActive (delegate to QP::QHsm).
void init(void const *const e, std::uint_fast8_t const qsId) override
Take the top-most initial transition in QActive (delegate to QP::QHsm).
QTicker(std::uint8_t const tickRate) noexcept
Constructor of the QTicker Active Object class \clearpage .
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 \clearpage .
@ 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 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/C++ Framework in C++ internal (package-scope) interface.
#define QF_CRIT_ENTRY()
Port-specific critical section entry.
#define QF_CRIT_EXIT()
Port-specific critical section exit.
#define QF_CRIT_STAT
Define the critical section status that was present before entering the critical section.
QS (QP/Spy software tracing) internal (package-scope) interface. \clearpage .
#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).