33#define QP_VERSION_STR "8.1.5"
34#define QP_VERSION 815U
36#define QP_RELEASE 0x648C4D80U
43#define QF_MAX_ACTIVE 32U
46#if (QF_MAX_ACTIVE > 64U)
47#error QF_MAX_ACTIVE exceeds the maximum of 64U;
50#ifndef QF_MAX_TICK_RATE
51#define QF_MAX_TICK_RATE 1U
54#if (QF_MAX_TICK_RATE > 15U)
55#error QF_MAX_TICK_RATE exceeds the maximum of 15U;
59#define QF_MAX_EPOOL 3U
62#if (QF_MAX_EPOOL > 15U)
63#error QF_MAX_EPOOL exceeds the maximum of 15U;
66#ifndef QF_TIMEEVT_CTR_SIZE
67#define QF_TIMEEVT_CTR_SIZE 4U
70#if (QF_TIMEEVT_CTR_SIZE > 4U)
71#error QF_TIMEEVT_CTR_SIZE defined incorrectly, expected 1U, 2U, or 4U;
74#ifndef QF_EVENT_SIZ_SIZE
75#define QF_EVENT_SIZ_SIZE 2U
78#if (QF_EVENT_SIZ_SIZE > 4U)
79#error QF_EVENT_SIZ_SIZE defined incorrectly, expected 1U, 2U, or 4U;
89#define Q_UNUSED_PAR(par_) (static_cast<void>(par_))
90#define Q_DIM(array_) (sizeof(array_) / sizeof((array_)[0U]))
91#define Q_UINT2PTR_CAST(type_, uint_) (reinterpret_cast<type_ *>(uint_))
157 std::array<QActionHandler, 1>
act;
216 void const *
const e,
217 std::uint_fast8_t
const qsId) = 0;
218 virtual void init(std::uint_fast8_t
const qsId);
220 QEvt const *
const e,
221 std::uint_fast8_t
const qsId) = 0;
232 static QState top(
void *
const me,
QEvt const *
const e)
noexcept;
235 explicit QAsm() noexcept;
264 void const *
const tatbl)
noexcept
280 static_cast<void>(s);
294 static_cast<void>(s);
308 void const *
const e,
309 std::uint_fast8_t
const qsId)
override;
311 QEvt const *
const e,
312 std::uint_fast8_t
const qsId)
override;
324 std::array<QStateHandler, MAX_NEST_DEPTH_> &path,
325 std::uint_fast8_t
const qsId);
328 std::array<QStateHandler, MAX_NEST_DEPTH_> &path,
329 std::uint_fast8_t
const qsId);
332 std::array<QStateHandler, MAX_NEST_DEPTH_> &path,
333 std::size_t
const depth,
334 std::uint_fast8_t
const qsId);
348 void const *
const e,
349 std::uint_fast8_t
const qsId)
override;
351 QEvt const *
const e,
352 std::uint_fast8_t
const qsId)
override;
363 std::uint_fast8_t const qsId);
365 QMState const * const curr_state,
366 QMState const * const tran_source,
367 std::uint_fast8_t const qsId);
370 std::uint_fast8_t const qsId);
381#define Q_STATE_DECL(state_) \
382 QP::QState state_ ## _h(QP::QEvt const * const e); \
383 static QP::QState state_(void * const me, QP::QEvt const * const e)
385#define Q_STATE_DEF(subclass_, state_) \
386 QP::QState subclass_::state_(void * const me, QP::QEvt const * const e) { \
387 return static_cast<subclass_ *>(me)->state_ ## _h(e); } \
388 QP::QState subclass_::state_ ## _h(QP::QEvt const * const e)
390#define Q_EVT_CAST(subclass_) (static_cast<subclass_ const *>(e))
391#define Q_STATE_CAST(handler_) (reinterpret_cast<QP::QStateHandler>(handler_))
393#define QM_STATE_DECL(state_) \
394 QP::QState state_ ## _h(QP::QEvt const * const e); \
395 static QP::QState state_(void * const me, QP::QEvt const * const e); \
396 static QP::QMState const state_ ## _s
398#define QM_ACTION_DECL(action_) \
399 QP::QState action_ ## _h(); \
400 static QP::QState action_(void * const me)
402#define QM_STATE_DEF(subclass_, state_) \
403 QP::QState subclass_::state_(void * const me, QP::QEvt const * const e) {\
404 return static_cast<subclass_ *>(me)->state_ ## _h(e); } \
405 QP::QState subclass_::state_ ## _h(QP::QEvt const * const e)
407#define QM_ACTION_DEF(subclass_, action_) \
408 QP::QState subclass_::action_(void * const me) { \
409 return static_cast<subclass_ *>(me)->action_ ## _h(); } \
410 QP::QState subclass_::action_ ## _h()
413 #define INIT(qsId_) init((qsId_))
414 #define DISPATCH(e_, qsId_) dispatch((e_), (qsId_))
416 #define INIT(dummy) init(0U)
417 #define DISPATCH(e_, dummy) dispatch((e_), 0U)
428#if (QF_TIMEEVT_CTR_SIZE == 1U)
430#elif (QF_TIMEEVT_CTR_SIZE == 2U)
432#elif (QF_TIMEEVT_CTR_SIZE == 4U)
436#if (QF_MAX_ACTIVE <= 8U)
438#elif (8U < QF_MAX_ACTIVE) && (QF_MAX_ACTIVE <= 16U)
440#elif (16 < QF_MAX_ACTIVE)
452#if (QF_MAX_ACTIVE > 32U)
467 bool hasElement(std::uint_fast8_t const n) const noexcept;
468 void insert(std::uint_fast8_t const n) noexcept;
469 void remove(std::uint_fast8_t const n) noexcept;
470 std::uint_fast8_t
findMax() const noexcept;
506#ifdef QACTIVE_THREAD_TYPE
510#ifdef QACTIVE_OS_OBJ_TYPE
514#ifdef QACTIVE_EQUEUE_TYPE
524 void const *
const e,
525 std::uint_fast8_t
const qsId)
override;
527 QEvt const *
const e,
528 std::uint_fast8_t
const qsId)
override;
535 void const * attr2 =
nullptr);
537 QEvtPtr * const qSto, std::uint_fast16_t const qLen,
538 void * const stkSto, std::uint_fast16_t const stkSize,
539 void const * const par =
nullptr);
541#ifdef QACTIVE_CAN_STOP
547 void const * const sender) noexcept
552 bool postx_(
QEvt const *
const e,
553 std::uint_fast16_t
const margin,
554 void const *
const sender)
noexcept;
555 void postLIFO(
QEvt const *
const e)
noexcept;
556 QEvt const * get_() noexcept;
557 static std::uint16_t getQueueUse(
558 std::uint_fast8_t const prio) noexcept;
559 static std::uint16_t getQueueFree(
560 std::uint_fast8_t const prio) noexcept;
561 static std::uint16_t getQueueMin(
562 std::uint_fast8_t const prio) noexcept;
565 QSignal const maxSignal) noexcept;
566 static
void publish_(
567 QEvt const * const e,
568 void const * const sender,
569 std::uint_fast8_t const qsId) noexcept;
570 void subscribe(
QSignal const sig) const noexcept;
571 void unsubscribe(
QSignal const sig) const noexcept;
572 void unsubscribeAll() const noexcept;
575 QEvt const * const e) const noexcept;
576 bool recall(
QEQueue * const eq) noexcept;
577 std::uint16_t flushDeferred(
579 std::uint_fast16_t const num = 0xFFFFU) const noexcept;
586#ifdef QACTIVE_THREAD_TYPE
599#ifdef QACTIVE_OS_OBJ_TYPE
611 QEvt const *
const e,
612 std::uint_fast16_t
const margin,
614 void const *
const sender)
noexcept;
617 QEvt const *
const e,
619 void const *
const sender)
noexcept;
624 QEvt const *
const e,
625 void const *
const sender);
627 QPSet *
const subscrSet,
628 QEvt const *
const e,
629 void const *
const sender);
659 void const *
const e,
660 std::uint_fast8_t
const qsId)
override;
662 QEvt const *
const e,
663 std::uint_fast8_t
const qsId)
override;
671#if (QF_MAX_TICK_RATE > 0U)
686 std::uint_fast8_t
const tickRate = 0U)
noexcept;
688 std::uint32_t
const nTicks,
689 std::uint32_t
const interval = 0U)
noexcept;
691 bool rearm(std::uint32_t const nTicks) noexcept;
710 std::uint_fast8_t
const tickRate,
711 void const *
const sender)
noexcept;
715 std::uint_fast8_t
const tickRate,
716 void const *
const sender);
721 std::uint_fast8_t
const tickRate,
723 void const * sender)
noexcept;
725 static bool noActive(std::uint_fast8_t
const tickRate)
noexcept;
741 std::uint_fast8_t const tickRate) noexcept;
751 explicit QTicker(std::uint8_t
const tickRate)
noexcept;
754 void const *
const e,
755 std::uint_fast8_t
const qsId)
override;
757 QEvt const *
const e,
758 std::uint_fast8_t
const qsId)
override;
759 void trig_(
void const *
const sender)
noexcept;
769 QSignal const maxSignal)
noexcept
777 void const *
const sender, std::uint_fast8_t
const qsId)
noexcept
785 std::uint_fast8_t
const prio)
noexcept
791#if (QF_MAX_TICK_RATE > 0U)
794 std::uint_fast8_t
const tickRate,
795 void const *
const sender)
noexcept
805 void *
const poolSto,
806 std::uint_fast32_t
const poolSize,
807 std::uint_fast16_t
const evtSize)
noexcept;
809std::uint16_t poolGetMaxBlockSize() noexcept;
810std::uint16_t
getPoolUse(std::uint_fast8_t const poolNum) noexcept;
811std::uint16_t
getPoolFree(std::uint_fast8_t const poolNum) noexcept;
812std::uint16_t
getPoolMin(std::uint_fast8_t const poolNum) noexcept;
814 std::uint_fast16_t const evtSize,
815 std::uint_fast16_t const margin,
817void gc(
QEvt const * const e) noexcept;
819 QEvt const * const e,
820 QEvt const * const evtRef) noexcept;
825 template<
class evtT_>
829 return static_cast<evtT_*
>(
832 template<
class evtT_>
833 inline evtT_ * q_new_x(std::uint_fast16_t
const margin,
838 return static_cast<evtT_*
>(
QP::QF::newX_(
sizeof(evtT_), margin, sig));
841 template<
class evtT_,
typename... Args>
845 evtT_ *e =
static_cast<evtT_*
>(
850 template<
class evtT_,
typename... Args>
851 inline evtT_ *
q_new_x(std::uint_fast16_t
const margin,
852 QSignal const sig, Args... args)
857 static_cast<evtT_*
>(
QP::QF::newX_(
sizeof(evtT_), margin, sig));
869 evtT_
const *& evtRef)
883 std::uint_fast16_t
const evtSize,
884 std::uint_fast16_t
const margin,
894#ifdef QF_ON_CONTEXT_SW
901#define Q_PRIO(prio_, pthre_) \
902 (static_cast<QP::QPrioSpec>((prio_) | (pthre_) << 8U))
905 #define Q_NEW(evtT_, sig_) (QP::QF::q_new<evtT_>((sig_)))
906 #define Q_NEW_X(evtT_, margin_, sig_) \
907 (QP::QF::q_new_x<evtT_>((margin_), (sig_)))
909 #define Q_NEW(evtT_, sig_, ...) \
910 (QP::QF::q_new<evtT_>((sig_), __VA_ARGS__))
911 #define Q_NEW_X(evtT_, margin_, sig_, ...) \
912 (QP::QF::q_new_x<evtT_>((margin_), (sig_), __VA_ARGS__))
915#define Q_NEW_REF(evtRef_, evtT_) (QP::QF::q_new_ref<evtT_>(e, (evtRef_)))
916#define Q_DELETE_REF(evtRef_) do { \
917 QP::QF::deleteRef_((evtRef_)); \
918 (evtRef_) = nullptr; \
922 #define PUBLISH(e_, sender_) \
923 publish_((e_), (sender_), (sender_)->getPrio())
924 #define POST(e_, sender_) post_((e_), (sender_))
925 #define POST_X(e_, margin_, sender_) \
926 postx_((e_), (margin_), (sender_))
927 #define TICK_X(tickRate_, sender_) tick((tickRate_), (sender_))
928 #define TRIG(sender_) trig_((sender_))
930 #define PUBLISH(e_, dummy) publish_((e_), nullptr, 0U)
931 #define POST(e_, dummy) post_((e_), nullptr)
932 #define POST_X(e_, margin_, dummy) postx_((e_), (margin_), nullptr)
933 #define TICK_X(tickRate_, dummy) tick((tickRate_), nullptr)
934 #define TRIG(sender_) trig_(nullptr)
937#define TICK(sender_) TICK_X(0U, (sender_))
939#ifndef QF_CRIT_EXIT_NOP
940 #define QF_CRIT_EXIT_NOP() (static_cast<void>(0))
Active object class (based on the QP::QHsm implementation strategy).
friend class QActiveDummy
QACTIVE_THREAD_TYPE m_thread
Port-dependent representation of the thread of the active object.
static std::uint16_t getQueueMin(std::uint_fast8_t const prio) noexcept
void unregister_() noexcept
Un-register the active object from the framework.
QACTIVE_OS_OBJ_TYPE const & getOsObject() const &
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 multicast_(QPSet *const subscrSet, QEvt const *const e, void const *const sender)
void post_(QEvt const *const e, 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)...
void register_() noexcept
Register this active object to be managed by the framework.
void postFIFO_(QEvt const *const e, void const *const sender)
static void publish_(QEvt const *const e, void const *const sender, std::uint_fast8_t const qsId) noexcept
Publish event to all subscribers of a given signal e->sig.
void stop()
Stops execution of an active object and removes it from the framework's supervision.
static void evtLoop_(QActive *act)
Event loop thread routine for executing an active object act (defined some in QP ports).
void setAttr(std::uint32_t attr1, void const *attr2=nullptr)
Generic setting of additional attributes (defined in some QP ports).
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.
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)...
static QActive * fromRegistry(std::uint_fast8_t const prio)
QActive(QStateHandler const initial) noexcept
QActive constructor (abstract base class).
std::uint8_t getPrio() const noexcept
QACTIVE_EQUEUE_TYPE m_eQueue
Port-dependent event-queue type (often QP::QEQueue).
QACTIVE_THREAD_TYPE const & getThread() const &&=delete
QStateHandler childState(QStateHandler const parentHandler) noexcept
static void psInit(QSubscrList *const subscrSto, QSignal const maxSignal) noexcept
Initializes the publish-subscribe facility for the application.
void start(QPrioSpec const prioSpec, QEvtPtr *const qSto, std::uint_fast16_t const qLen, void *const stkSto, std::uint_fast16_t const stkSize, void const *const par=nullptr)
Starts execution of an active object and registers the object with the framework.
QACTIVE_OS_OBJ_TYPE const & getOsObject() const &&=delete
void setThread(QACTIVE_THREAD_TYPE const &thr) 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.
QACTIVE_OS_OBJ_TYPE m_osObject
Port-dependent per-thread object.
virtual bool postFromISR(QEvt const *const e, std::uint_fast16_t const margin, void *const par, void const *const sender) noexcept
The "FromISR" variant used in the QP port to "FreeRTOS".
std::uint8_t m_prio
QF-priority [1..QF_MAX_ACTIVE] of this AO.
static void publishFromISR(QEvt const *const e, void *const par, void const *const sender) noexcept
The "FromISR" variant used in the QP port to "FreeRTOS".
QACTIVE_THREAD_TYPE const & getThread() const &
Abstract State Machine class (state machine interface).
QState qm_entry(QMState const *const s) noexcept
Internal helper function to execute state entry actions in QP::QMsm.
QAsm() noexcept
Constructor of the QP::QAsm base class.
QState qm_tran_hist(QMState const *const hist, void const *const tatbl) noexcept
Internal helper function to take a state transition to history in QP::QMsm.
QStateHandler state() const noexcept
static constexpr QState Q_RET_UNHANDLED
QState qm_tran(void const *const tatbl) noexcept
Internal helper function to take a state transition in QP::QMsm.
static constexpr QState Q_RET_TRAN
static constexpr QState QM_SUPER()
static constexpr QState Q_RET_ENTRY
QState qm_exit(QMState const *const s) noexcept
Internal helper function to execute state exit actions in QP::QMsm.
QState tran_hist(QStateHandler const hist) noexcept
Internal helper function to take a state transition to history in sublclasses of QP::QAsm.
QState super(QStateHandler const superstate) noexcept
Internal helper function to indicate superstate of a given state in sublclasses of QP::QAsm.
QState qm_tran_init(void const *const tatbl) noexcept
QAsmAttr m_temp
Temporary storage for target/act-table etc.
static constexpr QState Q_RET_IGNORED
virtual bool isIn(QStateHandler const stateHndl)=0
Virtual function to check whether the state machine is in a given state.
static constexpr QState Q_RET_SUPER
static constexpr QState Q_UNHANDLED()
virtual QStateHandler getStateHandler() const noexcept=0
Virtual method for getting the current state handler.
static constexpr QState Q_RET_TRAN_INIT
static constexpr QState Q_RET_TRAN_HIST
static constexpr QState Q_RET_EXIT
QMState const * stateObj() const noexcept
virtual ~QAsm()=default
Virtual destructor of the QP::QAsm abstract base class.
static constexpr QState Q_HANDLED()
virtual void init(void const *const e, std::uint_fast8_t const qsId)=0
Virtual function to take the top-most initial transition in the state machine.
QState tran(QStateHandler const target) noexcept
Internal helper function to take a state transition in sublclasses of QP::QAsm.
static constexpr QState QM_UNHANDLED()
static constexpr QSignal Q_INIT_SIG
static constexpr QActionHandler const Q_ACTION_NULL
QAsmAttr m_state
Current state (pointer to the current state-handler function).
virtual void dispatch(QEvt const *const e, std::uint_fast8_t const qsId)=0
Virtual function to dispatch an event to the state machine.
static constexpr QSignal Q_ENTRY_SIG
static constexpr QSignal Q_EXIT_SIG
static constexpr QSignal Q_EMPTY_SIG
static constexpr QState Q_RET_HANDLED
static constexpr QMState const * QM_STATE_NULL
static QState top(void *const me, QEvt const *const e) noexcept
Top state handler that ignores all events.
static constexpr QState QM_HANDLED()
void init(DynEvt const dummy) const noexcept
Event initialization for dynamic events (overload).
@ DYNAMIC
Dummy parameter for dynamic event initialization (see QEvt::QEvt(DynEvt)).
void init() const noexcept
Event initialization for dynamic events.
std::uint32_t poolNum_
Event pool number of this event.
constexpr QEvt(QSignal const s) noexcept
Event constexpr constructor applicable to immutable and mutable event instances.
std::uint32_t refCtr_
Event reference counter.
QEvt()=delete
Disallowed default event constructor.
std::uint32_t filler_
Member of QP::QEvt to make it identical size in QP/C++ and SafeQP/C++.
std::uint32_t sig
Signal of the event (see Event Signal).
void dispatch(QEvt const *const e, std::uint_fast8_t const qsId) override
Virtual override to dispatch an event to QHsm.
static constexpr std::size_t MAX_NEST_DEPTH_
void enter_target_(std::array< QStateHandler, MAX_NEST_DEPTH_ > &path, std::size_t const depth, std::uint_fast8_t const qsId)
Implementation of entry to the target state configuration.
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 override to take the top-most initial transition in QHsm.
std::size_t tran_simple_(std::array< QStateHandler, MAX_NEST_DEPTH_ > &path, std::uint_fast8_t const qsId)
Implementation of a simple state transition segment.
QHsm(QStateHandler const initial) noexcept
bool isIn(QStateHandler const stateHndl) noexcept override
Check whether the HSM is in a given state.
std::size_t tran_complex_(std::array< QStateHandler, MAX_NEST_DEPTH_ > &path, std::uint_fast8_t const qsId)
Implementation of a complex state transition segment.
QStateHandler getStateHandler() const noexcept override
Virtual method for getting the current state handler.
QMActive(QStateHandler const initial) noexcept
Constructor of QP::QMActive class.
QStateHandler getStateHandler() const noexcept override
Virtual method for getting the current state handler.
bool isIn(QStateHandler const stateHndl) noexcept override
Virtual function to check whether the state machine is in a given state.
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.
QMState const * childStateObj(QMState const *const parent) const noexcept
QMState const * childStateObj(QMState const *const parentHndl) const noexcept
Obtain the current active child state of a given parent in QP::QMsm.
void exitToTranSource_(QMState const *const curr_state, QMState const *const tran_source, std::uint_fast8_t const qsId)
Exit the given current-state up to the given tran-source in QP::QMsm.
QState execTatbl_(QMTranActTable const *const tatbl, std::uint_fast8_t const qsId)
Execute a transition-action table in QP::QMsm.
static QMState const * topQMState() noexcept
void dispatch(QEvt const *const e, std::uint_fast8_t const qsId) override
Implementation of dispatching events to a QP::QMsm.
QState enterHistory_(QMState const *const hist, std::uint_fast8_t const qsId)
Enter the history of a given state in QP::QMsm.
void init(void const *const e, std::uint_fast8_t const qsId) override
Implementation of the top-most initial transition in QP::QMsm.
bool isIn(QStateHandler const stateHndl) noexcept override
Tests if a given state is part of the current active state configuration.
QMsm(QStateHandler const initial) noexcept
Constructor of QP::QMsm.
QStateHandler getStateHandler() const noexcept override
Obtain the current active state from a MSM (read only).
Set of Active Objects of up to QF_MAX_ACTIVE elements.
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).
Subscriber List (for publish-subscribe).
QPSet m_set
The set of AOs that subscribed to a given 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
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.
QTicker(std::uint8_t const tickRate) noexcept
Constructor of the QTicker Active Object class.
void const * getAct() const &&=delete
static void tick(std::uint_fast8_t const tickRate, void const *const sender) noexcept
Processes all armed time events at every clock tick.
QTimeEvt * m_next
Link to the next time event in the list.
QTimeEvt * toTimeEvt() noexcept
bool disarm() noexcept
Disarm a time event.
QTimeEvt(QActive *const act, QSignal const sig, std::uint_fast8_t const tickRate=0U) noexcept
The "extended" constructor to initialize a Time Event.
static void tickFromISR(std::uint_fast8_t const tickRate, void *const par, void const *sender) noexcept
QTimeEvtCtr getInterval() const noexcept
static bool noActive(std::uint_fast8_t const tickRate) noexcept
Check if any time events are active at a given clock tick rate.
void * m_act
Active object that receives the time events.
QActive * toActive() noexcept
void armX(std::uint32_t const nTicks, std::uint32_t const interval=0U) noexcept
Arm a time event (extended version for one-shot or periodic time event).
QTimeEvtCtr getCtr() const noexcept
Get the current value of the down-counter of a time event.
bool rearm(std::uint32_t const nTicks) noexcept
Rearm a time event.
std::uint8_t getTickRate() const noexcept
QTimeEvtCtr m_ctr
Down-counter of the time event.
QTimeEvtCtr m_interval
Interval for periodic time event (zero for one-shot time event).
void const * getAct() const &
bool wasDisarmed() noexcept
Check the "was disarmed" status of a time event.
eXtended (blocking) thread of the QXK preemptive kernel
QF Active Object Framework namespace.
void deleteRef_(QEvt const *const evtRef) noexcept
void onCleanup()
Cleanup QF callback.
QEvt const * newRef_(QEvt const *const e, QEvt const *const evtRef) noexcept
QEvt * newXfromISR_(std::uint_fast16_t const evtSize, std::uint_fast16_t const margin, QSignal const sig) noexcept
void gc(QEvt const *const e) noexcept
Recycle a mutable (mutable) event.
QEvt * newX_(std::uint_fast16_t const evtSize, std::uint_fast16_t const margin, QSignal const sig) noexcept
evtT_ * q_new_x(std::uint_fast16_t const margin, QSignal const sig, Args... args)
void tick(std::uint_fast8_t const tickRate, void const *const sender) noexcept
evtT_ * q_new(QSignal const sig, Args... args)
void psInit(QSubscrList *const subscrSto, QSignal const maxSignal) noexcept
void gcFromISR(QEvt const *e) noexcept
std::uint16_t getPoolUse(std::uint_fast8_t const poolNum) noexcept
constexpr std::uint_fast16_t NO_MARGIN
Special value of margin that causes asserting failure in case event allocation or event posting fails...
void init()
QF initialization.
void q_new_ref(QP::QEvt const *const e, evtT_ const *&evtRef)
Create a new reference of the current event e.
std::uint16_t getPoolMin(std::uint_fast8_t const poolNum) noexcept
Obtain the minimum of free entries of the given event pool.
std::uint_fast16_t getQueueMin(std::uint_fast8_t const prio) noexcept
This function returns the minimum of free entries of the given event queue.
void q_delete_ref(evtT_ const *&evtRef)
Delete a new reference of the current event e.
int_t run()
Transfers control to QF to run the application.
void stop()
Invoked by the application layer to stop the QF framework and return control to the OS/Kernel (used i...
std::uint16_t getPoolFree(std::uint_fast8_t const poolNum) noexcept
void publish_(QEvt const *const e, void const *const sender, std::uint_fast8_t const qsId) noexcept
void onStartup()
Startup QF callback.
QP/C++ Framework namespace.
constexpr QSignal Q_USER_SIG
std::uint32_t QTimeEvtCtr
Data type to store the block-size defined based on the macro QF_TIMEEVT_CTR_SIZE.
QState(*)(void *const me) QActionHandler
Pointer to an action-handler function.
char const * version() noexcept
std::uint_fast8_t QState
Type returned from state-handler functions.
QState(*)(void *const me, QEvt const *const e) QStateHandler
Pointer to a state-handler function.
std::uint32_t QPSetBits
Bitmask for the internal representation of QPSet elements.
std::uint16_t QSignal
The signal of event QP::QEvt.
void(*)(QXThread *const me) QXThreadHandler
Pointer to an extended-thread handler function.
std::uint16_t QPrioSpec
Priority specification for Active Objects in QP.
int int_t
Alias for assertion-ID numbers in QP assertions and return from QP::QF::run().
#define Q_UNUSED_PAR(par_)
Helper macro to mark unused parameters of functions.
void QF_onContextSw(QP::QActive *prev, QP::QActive *next)
QF context switch callback used in built-in kernels (QV/QK/QXK).
#define QF_MAX_ACTIVE
Maximum # Active Objects in the system (1..64).
#define QACTIVE_OS_OBJ_TYPE
Port-specific QActive "OS-object" type.
#define QACTIVE_EQUEUE_TYPE
Port-specific QActive event queue type.
#define QACTIVE_THREAD_TYPE
Port-specific QActive thread type.
#define QF_LOG2(bitmask_)
Port-specific integer log-base-2 of a 32-bit bitmask.
The data type to store in the event queue ring-buffer.
State object for the QP::QMsm class (QM State Machine).
QActionHandler const entryAction
QStateHandler const stateHandler
QActionHandler const exitAction
QMState const * superstate
QActionHandler const initAction
Transition-Action Table for the QP::QMsm State Machine.
std::array< QActionHandler, 1 > act
Attribute of for the QP::QAsm class (Abstract State Machine).
QMTranActTable const * tatbl