37 #include "qs_dummy.hpp"
42Q_DEFINE_THIS_MODULE(
"qf_qact")
86 std::uint8_t prev_thre =
m_pthre;
87 std::uint8_t next_thre =
m_pthre;
89 for (std::uint8_t p =
m_prio - 1U; p > 0U; --p) {
120 std::uint8_t
const p =
m_prio;
135 void const *
const e,
136 std::uint_fast8_t
const qsId)
143 QEvt const *
const e,
144 std::uint_fast8_t
const qsId)
174 static constexpr std::array<std::uint8_t, 16> log2LUT = {
175 0U, 1U, 2U, 2U, 3U, 3U, 3U, 3U,
176 4U, 4U, 4U, 4U, 4U, 4U, 4U, 4U
178 std::uint_fast8_t n = 0U;
182#if (QF_MAX_ACTIVE > 16U)
189#if (QF_MAX_ACTIVE > 8U)
202 return static_cast<std::uint_fast8_t
>(n + log2LUT[x]);
209#if (QF_MAX_ACTIVE > 32U)
215#if (QF_MAX_ACTIVE <= 32U)
225#if (QF_MAX_ACTIVE <= 32U)
235#if (QF_MAX_ACTIVE <= 32U)
246#if (QF_MAX_ACTIVE <= 32U)
260#if (QF_MAX_ACTIVE <= 32U)
274#if (QF_MAX_ACTIVE <= 32U)
void unregister_() noexcept
Un-register the active object from the framework.
void register_() noexcept
Register this active object to be managed by the framework.
void dispatch(QEvt const *const e, std::uint_fast8_t const qsId) override
Virtual function to dispatch an event to the state machine.
bool isIn(QStateHandler const stateHndl) noexcept override
Virtual function to check whether the state machine is in a given state.
static QActive * fromRegistry(std::uint_fast8_t const prio)
QActive(QStateHandler const initial) noexcept
QActive constructor (abstract base class).
QStateHandler childState(QStateHandler const parentHandler) noexcept
QStateHandler getStateHandler() const noexcept override
Virtual method for getting the current state handler.
std::uint8_t m_pthre
Preemption-threshold [1..QF_MAX_ACTIVE] of this AO.
std::uint8_t m_prio
QF-priority [1..QF_MAX_ACTIVE] of this AO.
QAsm() noexcept
Constructor of the QP::QAsm base class.
QAsmAttr m_temp
Temporary storage for target/act-table etc.
QAsmAttr m_state
Current state (pointer to the current state-handler function).
static QState top(void *const me, QEvt const *const e) noexcept
Top state handler that ignores all events.
Private attributes of the QF framework.
Hierarchical State Machine class (QHsm-style state machine implementation strategy).
void dispatch(QEvt const *const e, std::uint_fast8_t const qsId) override
Virtual function to dispatch an event to the state machine.
QStateHandler childState(QStateHandler const parentHndl) noexcept
Obtain the current active child state of a given parent in QP::QMsm.
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.
bool isIn(QStateHandler const stateHndl) noexcept override
Check whether the HSM is in a given state.
QStateHandler getStateHandler() const noexcept override
Virtual method for getting the current state handler.
std::uint_fast8_t findMax() const noexcept
Find the maximum element in the set.
void remove(std::uint_fast8_t const n) noexcept
Remove element n from the priority-set (n = 1..QF_MAX_ACTIVE).
QPSetBits m_bits1
Bitmask for elements 33..64.
bool notEmpty() const noexcept
Find out whether the priority-set is NOT empty.
bool hasElement(std::uint_fast8_t const n) const noexcept
Find out whether the priority-set has element n.
QPSetBits m_bits0
Bitmask for elements 1..32.
void setEmpty() noexcept
Make the priority set empty.
bool isEmpty() const noexcept
Find out whether the priority-set is empty.
void insert(std::uint_fast8_t const n) noexcept
Insert element n into the priority-set (n = 1..QF_MAX_ACTIVE).
QF Active Object Framework namespace.
QP/C++ Framework namespace.
std::uint_fast8_t QF_LOG2(QP::QPSetBits const bitmask) noexcept
QState(*)(void *const me, QEvt const *const e) QStateHandler
Pointer to a state-handler function.
std::array< QActive *, QF_MAX_ACTIVE+1U > QActive_registry_
Internal array of pointers to the registered Active Objects.
std::uint32_t QPSetBits
Bitmask for the internal representation of QPSet elements.
#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
QS (QP/Spy software tracing) internal (package-scope) interface.
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).