49Q_DEFINE_THIS_MODULE(
"qf_actq")
54#if (QP_VERSION < 730U) || (QP_VERSION != ((QP_RELEASE^4294967295U)%0x2710U))
55#error qpcpp version 7.3.0 or higher required
64 std::uint_fast16_t
const margin,
65 void const *
const sender)
noexcept
74 return static_cast<QActiveDummy *
>(
this)->fakePost(e, margin, sender);
111 else if (tmp >
static_cast<QEQueueCtr>(margin)) {
119 if (e->getPoolNum_() != 0U) {
126 m_eQueue.m_nFree = tmp;
128 m_eQueue.m_nFree_dis =
static_cast<QEQueueCtr>(~tmp);
131 if (m_eQueue.m_nMin > tmp) {
132 m_eQueue.m_nMin = tmp;
149 if (QS_LOC_CHECK_(m_prio)) {
153 QS::onTestPost(sender,
this, e, status);
160 if (m_eQueue.m_frontEvt ==
nullptr) {
161 m_eQueue.m_frontEvt = e;
165 m_eQueue.m_frontEvt_dis =
166 static_cast<std::uintptr_t
>(~Q_PTR2UINT_CAST_(e));
170 if (m_state.act ==
nullptr) {
171 QXTHREAD_EQUEUE_SIGNAL_(
this);
181 tmp = m_eQueue.m_head;
183 dis =
static_cast<QEQueueCtr>(~m_eQueue.m_head_dis);
186 m_eQueue.m_ring[tmp] = e;
189 tmp = m_eQueue.m_end;
193 m_eQueue.m_head = tmp;
195 m_eQueue.m_head_dis =
static_cast<QEQueueCtr>(~tmp);
218 if (QS_LOC_CHECK_(m_prio)) {
222 QS::onTestPost(sender,
this, e, status);
232 #if (QF_MAX_EPOOL > 0U)
251 static_cast<QActiveDummy *
>(
this)->QActiveDummy::fakePostLIFO(e);
278 if (e->getPoolNum_() != 0U) {
284 m_eQueue.m_nFree = tmp;
286 m_eQueue.m_nFree_dis =
static_cast<QEQueueCtr>(~tmp);
289 if (m_eQueue.m_nMin > tmp) {
290 m_eQueue.m_nMin = tmp;
306 if (QS_LOC_CHECK_(m_prio)) {
310 QS::onTestPost(
nullptr,
this, e,
true);
317 QEvt const *
const frontEvt = m_eQueue.m_frontEvt;
318 m_eQueue.m_frontEvt = e;
320 m_eQueue.m_frontEvt_dis =
321 static_cast<std::uintptr_t
>(~Q_PTR2UINT_CAST_(e));
324 if (frontEvt !=
nullptr) {
325 tmp = m_eQueue.m_tail;
327 dis =
static_cast<QEQueueCtr>(~m_eQueue.m_tail_dis);
331 if (tmp == m_eQueue.m_end) {
334 m_eQueue.m_tail = tmp;
336 m_eQueue.m_tail_dis =
static_cast<QEQueueCtr>(~tmp);
338 m_eQueue.m_ring[tmp] = frontEvt;
371 ==
static_cast<std::uintptr_t
>(~
m_eQueue.m_frontEvt_dis));
395 dis =
static_cast<QEQueueCtr>(~m_eQueue.m_tail_dis);
402 static_cast<std::uintptr_t
>(~Q_PTR2UINT_CAST_(frontEvt));
420 static_cast<std::uintptr_t
>(~Q_PTR2UINT_CAST_(
nullptr));
453 m_eQueue.m_head =
static_cast<QEQueueCtr>(tickRate);
455 m_eQueue.m_head_dis =
static_cast<QEQueueCtr>(~tickRate);
461 void const *
const e,
462 std::uint_fast8_t
const qsId)
482 QEvt const *
const e,
483 std::uint_fast8_t
const qsId)
512 for (; nTicks > 0U; --nTicks) {
524 static QEvt const tickEvt(0U);
532 if (m_eQueue.m_frontEvt ==
nullptr) {
539 1U ==
static_cast<QEQueueCtr>(~m_eQueue.m_nFree_dis));
541 0U ==
static_cast<QEQueueCtr>(~m_eQueue.m_tail_dis));
544 m_eQueue.m_frontEvt = &tickEvt;
545 m_eQueue.m_nFree = 0U;
547 m_eQueue.m_frontEvt_dis =
548 static_cast<std::uintptr_t
>(~Q_PTR2UINT_CAST_(&tickEvt));
549 m_eQueue.m_nFree_dis =
static_cast<QEQueueCtr>(~0U);
561 0U ==
static_cast<QEQueueCtr>(~m_eQueue.m_nFree_dis));
563 nTicks ==
static_cast<QEQueueCtr>(~m_eQueue.m_tail_dis));
569 m_eQueue.m_tail = nTicks;
571 m_eQueue.m_tail_dis =
static_cast<QEQueueCtr>(~nTicks);
Dummy Active Object for testing.
Active object class (based on the QHsm implementation strategy)
bool post_(QEvt const *const e, std::uint_fast16_t const margin, void const *const sender) noexcept
QACTIVE_EQUEUE_TYPE m_eQueue
QEvt const * get_() noexcept
void postLIFO(QEvt const *const e) noexcept
QSignal sig
Signal of the event (see Event Signal)
std::uint8_t volatile refCtr_
Event reference counter.)
std::uint_fast8_t getPoolNum_() const noexcept
Internal function to get the event pool-number of the given event.
void trig_(void const *const sender) noexcept
void dispatch(QEvt const *const e, std::uint_fast8_t const qsId) override
Virtual function to dispatch an event to the state machine.
void init(void const *const e, std::uint_fast8_t const qsId) override
Virtual function to take the top-most initial transition in the state machine.
static void tick(std::uint_fast8_t const tickRate, void const *const sender) noexcept
void gc(QEvt const *const e) noexcept
Recycle a mutable (mutable) event.
constexpr std::uint_fast16_t NO_MARGIN
void QEvt_refCtr_inc_(QEvt const *const e) noexcept
#define QACTIVE_EQUEUE_SIGNAL_(me_)
#define QACTIVE_EQUEUE_WAIT_(me_)
#define Q_UNUSED_PAR(par_)
Helper macro to clearly mark unused parameters of functions.
#define Q_STATE_CAST(handler_)
Internal (package scope) QP/C++ interface.
#define Q_PTR2UINT_CAST_(ptr_)
Internal helper macro to cast pointers to integers.
#define QS_2U8_PRE(data1_, data2_)
#define QS_TEST_PROBE_DEF(fun_)
#define QS_TEST_PROBE_ID(id_, code_)
#define QS_BEGIN_PRE(rec_, qsId_)
QS/C++ port to a 32-bit CPU, generic C++ compiler.
QP Functional Safety (FuSa) Subsystem.
#define Q_ASSERT_INCRIT(id_, expr_)
#define Q_INVARIANT_INCRIT(id_, expr_)
#define Q_REQUIRE_INCRIT(id_, expr_)
#define Q_ERROR_INCRIT(id_)