QP/C++  7.0.1
Real-Time Embedded Framework
qf.hpp
Go to the documentation of this file.
1//============================================================================
2// QP/C++ Real-Time Embedded Framework (RTEF)
3// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
4//
5// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
6//
7// This software is dual-licensed under the terms of the open source GNU
8// General Public License version 3 (or any later version), or alternatively,
9// under the terms of one of the closed source Quantum Leaps commercial
10// licenses.
11//
12// The terms of the open source GNU General Public License version 3
13// can be found at: <www.gnu.org/licenses/gpl-3.0>
14//
15// The terms of the closed source Quantum Leaps commercial licenses
16// can be found at: <www.state-machine.com/licensing>
17//
18// Redistributions in source code must retain this top-level comment block.
19// Plagiarizing this software to sidestep the license obligations is illegal.
20//
21// Contact information:
22// <www.state-machine.com>
23// <info@state-machine.com>
24//============================================================================
30
31#ifndef QF_HPP
32#define QF_HPP
33
34//============================================================================
35#ifndef QPSET_HPP
36#include "qpset.hpp"
37#endif
38
39#ifdef Q_EVT_CTOR
40#include <new> // for placement new
41#endif // Q_EVT_CTOR
42
43//============================================================================
44// apply defaults for all undefined configuration parameters
45//
46#ifndef QF_EVENT_SIZ_SIZE
48 #define QF_EVENT_SIZ_SIZE 2U
49#endif
50
51#ifndef QF_MAX_EPOOL
53 #define QF_MAX_EPOOL 3U
54#endif
55
56#ifndef QF_MAX_TICK_RATE
59 #define QF_MAX_TICK_RATE 1U
60#elif (QF_MAX_TICK_RATE > 15U)
61 #error "QF_MAX_TICK_RATE exceeds the maximum of 15U"
62#endif
63
64#ifndef QF_TIMEEVT_CTR_SIZE
67 #define QF_TIMEEVT_CTR_SIZE 2U
68#endif
69
70//============================================================================
71namespace QP {
72
73#if (QF_EVENT_SIZ_SIZE == 1U)
74 using QEvtSize = std::uint8_t;
75#elif (QF_EVENT_SIZ_SIZE == 2U)
82 using QEvtSize = std::uint16_t;
83#elif (QF_EVENT_SIZ_SIZE == 4U)
84 using QEvtSize = std::uint32_t;
85#else
86 #error "QF_EVENT_SIZ_SIZE defined incorrectly, expected 1U, 2U, or 4U"
87#endif
88
89//============================================================================
90#if (QF_TIMEEVT_CTR_SIZE == 1U)
91 using QTimeEvtCtr = std::uint8_t;
92#elif (QF_TIMEEVT_CTR_SIZE == 2U)
102 using QTimeEvtCtr = std::uint16_t;
103#elif (QF_TIMEEVT_CTR_SIZE == 4U)
104 using QTimeEvtCtr = std::uint32_t;
105#else
106 #error "QF_TIMEEVT_CTR_SIZE defined incorrectly, expected 1U, 2U, or 4U"
107#endif
108
109class QEQueue; // forward declaration
110
111//============================================================================
139class QActive : public QHsm {
140public: // for access from extern "C" functions
141#ifdef QF_EQUEUE_TYPE
153 QF_EQUEUE_TYPE m_eQueue;
154#endif
155
156#ifdef QF_OS_OBJECT_TYPE
164 QF_OS_OBJECT_TYPE m_osObject;
165#endif
166
167#ifdef QF_THREAD_TYPE
174 QF_THREAD_TYPE m_thread;
175#endif
176
177#ifdef QXK_HPP // QXK kernel used?
179 std::uint8_t m_dynPrio;
180#endif
181
183 std::uint8_t m_prio;
184
185protected:
187 QActive(QStateHandler const initial) noexcept;
188
189public:
209 virtual void start(std::uint_fast8_t const prio,
210 QEvt const * * const qSto, std::uint_fast16_t const qLen,
211 void * const stkSto, std::uint_fast16_t const stkSize,
212 void const * const par);
213
215 virtual void start(std::uint_fast8_t const prio,
216 QEvt const * * const qSto, std::uint_fast16_t const qLen,
217 void * const stkSto, std::uint_fast16_t const stkSize)
218 {
219 this->start(prio, qSto, qLen, stkSto, stkSize, nullptr);
220 }
221
222#ifdef QF_ACTIVE_STOP
231 void stop(void);
232#endif
233
234#ifndef Q_SPY
268 virtual bool post_(QEvt const * const e,
269 std::uint_fast16_t const margin) noexcept;
270#else
271 virtual bool post_(QEvt const * const e, std::uint_fast16_t const margin,
272 void const * const sender) noexcept;
273#endif
274
293 virtual void postLIFO(QEvt const * const e) noexcept;
294
317 void unsubscribeAll(void) const noexcept;
318
337 void subscribe(enum_t const sig) const noexcept;
338
364 void unsubscribe(enum_t const sig) const noexcept;
365
390 bool defer(QEQueue * const eq, QEvt const * const e) const noexcept;
391
414 bool recall(QEQueue * const eq) noexcept;
415
432 std::uint_fast16_t flushDeferred(QEQueue * const eq) const noexcept;
433
435 std::uint_fast8_t getPrio(void) const noexcept {
436 return static_cast<std::uint_fast8_t>(m_prio);
437 }
438
440 void setPrio(std::uint_fast8_t const prio) {
441 m_prio = static_cast<std::uint8_t>(prio);
442 }
443
445 void setAttr(std::uint32_t attr1, void const *attr2 = nullptr);
446
447#ifdef QF_OS_OBJECT_TYPE
450 QF_OS_OBJECT_TYPE &getOsObject(void) noexcept { return m_osObject; }
451#endif
452
453#ifdef QF_THREAD_TYPE
456 QF_THREAD_TYPE &getThread(void) noexcept { return m_thread; }
457#endif
458
480 QEvt const *get_(void) noexcept;
481
482// duplicated API to be used exclusively inside ISRs (useful in some QP ports)
483#ifdef QF_ISR_API
484#ifdef Q_SPY
485 virtual bool postFromISR_(QEvt const * const e,
486 std::uint_fast16_t const margin, void *par,
487 void const * const sender) noexcept;
488#else
489 virtual bool postFromISR_(QEvt const * const e,
490 std::uint_fast16_t const margin, void *par) noexcept;
491#endif // Q_SPY
492#endif // QF_ISR_API
493
494// friendships...
495private:
496 friend class QF;
497 friend class QTimeEvt;
498 friend class QTicker;
499#ifdef QK_HPP
500 friend class QMutex;
501#endif // QK_HPP
502#ifdef QXK_HPP
503 friend class QXK;
504 friend class QXThread;
505 friend class QXMutex;
506 friend class QXSemaphore;
507#endif // QXK_HPP
508#ifdef Q_UTEST
509 friend class QActiveDummy;
510#endif // Q_UTEST
511};
512
513//============================================================================
535class QMActive : public QActive {
536public:
537 // all the following operations delegate to the QHsm class...
538 void init(void const * const e,
539 std::uint_fast8_t const qs_id) override;
540 void init(std::uint_fast8_t const qs_id) override;
541 void dispatch(QEvt const * const e,
542 std::uint_fast8_t const qs_id) override;
543
544#ifdef Q_SPY
546 QStateHandler getStateHandler() noexcept override;
547#endif
548
550 bool isInState(QMState const * const st) const noexcept;
551
553 QMState const *stateObj(void) const noexcept {
554 return m_state.obj;
555 }
556
558 QMState const *childStateObj(QMState const * const parent) const noexcept;
559
560protected:
562 QMActive(QStateHandler const initial) noexcept;
563
564private:
566 using QHsm::isIn;
567 using QHsm::state;
568 using QHsm::childState;
569};
570
571//============================================================================
609class QTimeEvt : public QEvt {
610private:
611
613 QTimeEvt * volatile m_next;
614
620 void * volatile m_act;
621
629
638
639public:
641 QTimeEvt(QActive * const act, enum_t const sgnl,
642 std::uint_fast8_t const tickRate = 0U) noexcept;
643
673 void armX(QTimeEvtCtr const nTicks,
674 QTimeEvtCtr const interval = 0U) noexcept;
675
693 bool disarm(void) noexcept;
694
716 bool rearm(QTimeEvtCtr const nTicks) noexcept;
717
738 bool wasDisarmed(void) noexcept;
739
741 QTimeEvtCtr currCtr(void) const noexcept;
742
743private:
749 QTimeEvt(void) noexcept;
750
752 QTimeEvt(QTimeEvt const &) = delete;
753
755 QTimeEvt & operator=(QTimeEvt const &) = delete;
756
758 QActive *toActive(void) noexcept {
759 return static_cast<QActive *>(m_act);
760 }
761
763 QTimeEvt *toTimeEvt(void) noexcept {
764 return static_cast<QTimeEvt *>(m_act);
765 }
766
767 friend class QF;
768 friend class QS;
769#ifdef QXK_HPP
770 friend class QXThread;
771 friend void QXK_activate_(void);
772#endif // QXK_HPP
773};
774
775//============================================================================
783
784//============================================================================
790class QF {
791public:
793 static char const *getVersion(void) noexcept {
794 return versionStr;
795 }
796
809 static void init(void);
810
842 static void psInit(QSubscrList * const subscrSto,
843 enum_t const maxSignal) noexcept;
844
876 static void poolInit(void * const poolSto,
877 std::uint_fast32_t const poolSize,
878 std::uint_fast16_t const evtSize) noexcept;
879
881 static std::uint_fast16_t poolGetMaxBlockSize(void) noexcept;
882
883
894 static int_t run(void);
895
897 static void onStartup(void);
898
900 static void onCleanup(void);
901
920 static void stop(void);
921
922#ifndef Q_SPY
923 static void publish_(QEvt const * const e) noexcept;
924 static void tickX_(std::uint_fast8_t const tickRate) noexcept;
925#else
944 static void publish_(QEvt const * const e,
945 void const * const sender,
946 std::uint_fast8_t const qs_id) noexcept;
947
969 static void tickX_(std::uint_fast8_t const tickRate,
970 void const * const sender) noexcept;
971#endif // Q_SPY
972
988 static bool noTimeEvtsActiveX(std::uint_fast8_t const tickRate) noexcept;
989
1004 static std::uint_fast16_t getPoolMin(std::uint_fast8_t const poolId)
1005 noexcept;
1006
1027 static std::uint_fast16_t getQueueMin(std::uint_fast8_t const prio)
1028 noexcept;
1029
1058 static QEvt *newX_(std::uint_fast16_t const evtSize,
1059 std::uint_fast16_t const margin,
1060 enum_t const sig) noexcept;
1061
1086 static void gc(QEvt const * const e) noexcept;
1087
1103 static QEvt const *newRef_(QEvt const * const e,
1104 QEvt const * const evtRef) noexcept;
1105
1117 static void deleteRef_(QEvt const * const evtRef) noexcept;
1118
1134 static void remove_(QActive * const a) noexcept;
1135
1138
1140 static void thread_(QActive *act);
1141
1157 static void add_(QActive * const a) noexcept;
1158
1173 static void bzero(void * const start,
1174 std::uint_fast16_t const len) noexcept;
1175
1176// API to be used exclusively inside ISRs (useful in some QP ports)
1177#ifdef QF_ISR_API
1178#ifdef Q_SPY
1179 static void publishFromISR_(QEvt const *e, void *par,
1180 void const *sender) noexcept;
1181 static void tickXfromISR_(std::uint_fast8_t const tickRate, void *par,
1182 void const * const sender) noexcept;
1183#else
1184 static void publishFromISR_(QEvt const *e, void *par) noexcept;
1185 static void tickXfromISR_(std::uint_fast8_t const tickRate,
1186 void *par) noexcept;
1187#endif // Q_SPY
1188
1189 static QEvt *newXfromISR_(std::uint_fast16_t const evtSize,
1190 std::uint_fast16_t const margin,
1191 enum_t const sig) noexcept;
1192 static void gcFromISR(QEvt const *e) noexcept;
1193
1194#endif // QF_ISR_API
1195
1196// to be used in QF ports only...
1197private:
1200
1201 friend class QActive;
1202 friend class QTimeEvt;
1203 friend class QS;
1204#ifdef QXK_HPP
1205 friend class QXThread;
1206#endif // QXK_HPP
1207};
1208
1211std::uint_fast16_t const QF_NO_MARGIN = 0xFFFFU;
1212
1213
1214//============================================================================
1229class QTicker : public QActive {
1230public:
1231 explicit QTicker(std::uint_fast8_t const tickRate) noexcept; // ctor
1232
1233 void init(void const * const e,
1234 std::uint_fast8_t const qs_id) noexcept override;
1235 void init(std::uint_fast8_t const qs_id) noexcept override;
1236 void dispatch(QEvt const * const e,
1237 std::uint_fast8_t const qs_id) noexcept override;
1238#ifndef Q_SPY
1242 bool post_(QEvt const * const e,
1243 std::uint_fast16_t const margin) noexcept override;
1244#else
1245 bool post_(QEvt const * const e, std::uint_fast16_t const margin,
1246 void const * const sender) noexcept override;
1247#endif
1248 void postLIFO(QEvt const * const e) noexcept override;
1249};
1250
1251} // namespace QP
1252
1253//============================================================================
1254#ifndef QF_CRIT_EXIT_NOP
1265 #define QF_CRIT_EXIT_NOP() (static_cast<void>(0))
1266#endif
1267
1268//============================================================================
1269// Provide the constructor for the QEvt class?
1270#ifdef Q_EVT_CTOR
1271
1272 #define Q_NEW(evtT_, sig_, ...) \
1273 (new(QP::QF::newX_(sizeof(evtT_), QP::QF_NO_MARGIN, 0)) \
1274 evtT_((sig_), ##__VA_ARGS__))
1275
1276 #define Q_NEW_X(e_, evtT_, margin_, sig_, ...) do { \
1277 (e_) = static_cast<evtT_ *>( \
1278 QP::QF::newX_(sizeof(evtT_), (margin_), 0)); \
1279 if ((e_) != nullptr) { \
1280 new((e_)) evtT_((sig_), ##__VA_ARGS__); \
1281 } \
1282 } while (false)
1283
1284#else // QEvt is a POD (Plain Old Datatype)
1285
1307 #define Q_NEW(evtT_, sig_) (static_cast<evtT_ *>( \
1308 QP::QF::newX_(sizeof(evtT_), QP::QF_NO_MARGIN, (sig_))))
1309
1336 #define Q_NEW_X(e_, evtT_, margin_, sig_) \
1337 ((e_) = static_cast<evtT_ *>(QP::QF::newX_( \
1338 sizeof(evtT_), (margin_), (sig_))))
1339#endif
1340
1361#define Q_NEW_REF(evtRef_, evtT_) \
1362 ((evtRef_) = static_cast<evtT_ const *>(QP::QF::newRef_(e, (evtRef_))))
1363
1379#define Q_DELETE_REF(evtRef_) do { \
1380 QP::QF::deleteRef_((evtRef_)); \
1381 (evtRef_) = 0U; \
1382} while (false)
1383
1384//============================================================================
1385// QS software tracing integration, only if enabled
1386#ifdef Q_SPY
1387
1411 #define TICK_X(tickRate_, sender_) tickX_((tickRate_), (sender_))
1412
1435 #define PUBLISH(e_, sender_) \
1436 publish_((e_), (sender_), (sender_)->getPrio())
1437
1459 #define POST(e_, sender_) post_((e_), QP::QF_NO_MARGIN, (sender_))
1460
1494 #define POST_X(e_, margin_, sender_) \
1495 post_((e_), (margin_), (sender_))
1496
1497#else
1498
1499 #define PUBLISH(e_, dummy_) publish_((e_))
1500 #define POST(e_, dummy_) post_((e_), QP::QF_NO_MARGIN)
1501 #define POST_X(e_, margin_, dummy_) post_((e_), (margin_))
1502 #define TICK_X(tickRate_, dummy_) tickX_((tickRate_))
1503
1504#endif // Q_SPY
1505
1508#define TICK(sender_) TICK_X(0U, (sender_))
1509
1510#endif // QF_HPP
Dummy Active Object class for testing (inherits QP::QActive)
Definition: qs.hpp:804
QActive active object class (based on QP::QHsm implementation strategy)
Definition: qf.hpp:139
std::uint8_t m_prio
QF priority (1..QF_MAX_ACTIVE) of this active object.
Definition: qf.hpp:183
void setAttr(std::uint32_t attr1, void const *attr2=nullptr)
Generic setting of additional attributes (useful in QP ports)
friend class QTicker
Definition: qf.hpp:498
virtual void postLIFO(QEvt const *const e) noexcept
Posts an event directly to the event queue of the active object using the Last-In-First-Out (LIFO) po...
Definition: qf_actq.cpp:181
virtual void start(std::uint_fast8_t const prio, QEvt const **const qSto, std::uint_fast16_t const qLen, void *const stkSto, std::uint_fast16_t const stkSize)
Overloaded start function (no initialization event)
Definition: qf.hpp:215
bool defer(QEQueue *const eq, QEvt const *const e) const noexcept
Defer an event to a given separate event queue.
Definition: qf_defer.cpp:53
virtual bool post_(QEvt const *const e, std::uint_fast16_t const margin, void const *const sender) noexcept
Definition: qf_actq.cpp:60
void unsubscribeAll(void) const noexcept
Unsubscribes from the delivery of all signals to the active object.
Definition: qf_ps.cpp:187
void subscribe(enum_t const sig) const noexcept
Subscribes for delivery of signal sig to the active object.
Definition: qf_ps.cpp:140
std::uint_fast8_t getPrio(void) const noexcept
Get the priority of the active object.
Definition: qf.hpp:435
bool recall(QEQueue *const eq) noexcept
Recall a deferred event from a given event queue.
Definition: qf_defer.cpp:69
void stop(void)
Stops execution of an active object and removes it from the framework's supervision.
Definition: qutest.cpp:110
virtual void start(std::uint_fast8_t const prio, QEvt const **const qSto, std::uint_fast16_t const qLen, void *const stkSto, std::uint_fast16_t const stkSize, void const *const par)
Starts execution of an active object and registers the object with the framework.
Definition: qk.cpp:114
std::uint_fast16_t flushDeferred(QEQueue *const eq) const noexcept
Flush the specified deferred queue 'eq'.
Definition: qf_defer.cpp:120
void unsubscribe(enum_t const sig) const noexcept
Unsubscribes from the delivery of signal sig to the active object.
Definition: qf_ps.cpp:162
QEvt const * get_(void) noexcept
Get an event from the event queue of an active object.
Definition: qf_actq.cpp:245
void setPrio(std::uint_fast8_t const prio)
Set the priority of the active object.
Definition: qf.hpp:440
Native QF Event Queue class.
Definition: qequeue.hpp:113
QF real-time active object framework.
Definition: qf.hpp:790
static std::uint_fast16_t getPoolMin(std::uint_fast8_t const poolId) noexcept
This function returns the minimum of free entries of the given event pool.
Definition: qf_mem.cpp:219
static void onStartup(void)
Startup QF callback.
static void psInit(QSubscrList *const subscrSto, enum_t const maxSignal) noexcept
Publish-subscribe initialization.
Definition: qf_ps.cpp:58
static 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 of an active object (indic...
Definition: qf_actq.cpp:293
static void init(void)
QF initialization.
Definition: qk.cpp:69
static void onCleanup(void)
Cleanup QF callback.
static void thread_(QActive *act)
Thread routine for executing an active object act.
static bool noTimeEvtsActiveX(std::uint_fast8_t const tickRate) noexcept
Returns true if all time events are inactive and false any time event is active.
Definition: qf_time.cpp:164
static int_t run(void)
Transfers control to QF to run the application.
Definition: qk.cpp:93
static QTimeEvt timeEvtHead_[QF_MAX_TICK_RATE]
heads of linked lists of time events, one for every clock tick rate
Definition: qf.hpp:1199
static void gc(QEvt const *const e) noexcept
Recycle a dynamic event.
Definition: qf_dyn.cpp:140
static void deleteRef_(QEvt const *const evtRef) noexcept
Internal QF implementation of deleting event reference.
Definition: qf_dyn.cpp:226
static QEvt * newX_(std::uint_fast16_t const evtSize, std::uint_fast16_t const margin, enum_t const sig) noexcept
Internal QF implementation of creating new dynamic mutable event.
Definition: qf_dyn.cpp:83
static void bzero(void *const start, std::uint_fast16_t const len) noexcept
Clear a specified region of memory to zero.
Definition: qf_act.cpp:81
static void add_(QActive *const a) noexcept
Register an active object to be managed by the framework.
Definition: qf_act.cpp:56
static void stop(void)
Function invoked by the application layer to stop the QF application and return control to the OS/Ker...
Definition: qk.cpp:87
static QActive * active_[QF_MAX_ACTIVE+1U]
Internal array of registered active objects.
Definition: qf.hpp:1137
static std::uint_fast16_t poolGetMaxBlockSize(void) noexcept
Obtain the block size of any registered event pools.
Definition: qf_dyn.cpp:244
static void remove_(QActive *const a) noexcept
Remove the active object from the framework.
Definition: qf_act.cpp:68
static void poolInit(void *const poolSto, std::uint_fast32_t const poolSize, std::uint_fast16_t const evtSize) noexcept
Event pool initialization for dynamic allocation of events.
Definition: qf_dyn.cpp:57
static QEvt const * newRef_(QEvt const *const e, QEvt const *const evtRef) noexcept
Internal QF implementation of creating new event reference.
Definition: qf_dyn.cpp:199
static void tickX_(std::uint_fast8_t const tickRate, void const *const sender) noexcept
Processes all armed time events at every clock tick.
Definition: qf_time.cpp:58
static char const * getVersion(void) noexcept
get the current QF version number string of the form X.Y.Z
Definition: qf.hpp:793
static void publish_(QEvt const *const e, void const *const sender, std::uint_fast8_t const qs_id) noexcept
Publish event to all subscribers of a given signal e->sig
Definition: qf_ps.cpp:74
Hierarchical State Machine base class.
Definition: qep.hpp:258
friend class QActive
Definition: qep.hpp:549
QStateHandler childState(QStateHandler const parent) noexcept
Obtain the current active child state of a given parent.
Definition: qep_hsm.cpp:511
QHsmAttr m_state
current active state (state-variable)
Definition: qep.hpp:259
QStateHandler state(void) const noexcept
Obtain the current state (state handler function)
Definition: qep.hpp:332
bool isIn(QStateHandler const s) noexcept
Tests if a given state is part of the current active state configuration.
Definition: qep_hsm.cpp:486
friend class QMActive
Definition: qep.hpp:550
QMActive active object (based on QP::QMsm implementation)
Definition: qf.hpp:535
QStateHandler getStateHandler() noexcept override
Get the current state handler of the QMsm.
Definition: qf_qmact.cpp:98
void dispatch(QEvt const *const e, std::uint_fast8_t const qs_id) override
Dispatches an event to QHsm.
Definition: qf_qmact.cpp:77
QMState const * childStateObj(QMState const *const parent) const noexcept
Obtain the current active child state of a given parent (read only)
Definition: qf_qmact.cpp:88
void init(void const *const e, std::uint_fast8_t const qs_id) override
executes the top-most initial transition in QP::QHsm
Definition: qf_qmact.cpp:67
QMState const * stateObj(void) const noexcept
Return the current active state object (read only)
Definition: qf.hpp:553
bool isInState(QMState const *const st) const noexcept
Tests if a given state is part of the active state configuration.
Definition: qf_qmact.cpp:84
QS software tracing facilities for output (QS-TX)
Definition: qs.hpp:74
"Ticker" Active Object class (inherits QP::QActive)
Definition: qf.hpp:1229
void init(void const *const e, std::uint_fast8_t const qs_id) noexcept override
executes the top-most initial transition in QP::QHsm
Definition: qf_actq.cpp:315
void postLIFO(QEvt const *const e) noexcept override
Posts an event directly to the event queue of the active object using the Last-In-First-Out (LIFO) po...
Definition: qf_actq.cpp:393
bool post_(QEvt const *const e, std::uint_fast16_t const margin, void const *const sender) noexcept override
Definition: qf_actq.cpp:348
void dispatch(QEvt const *const e, std::uint_fast8_t const qs_id) noexcept override
Dispatches an event to QHsm.
Definition: qf_actq.cpp:323
Time Event class (inherits QP:QEvt)
Definition: qf.hpp:609
QTimeEvtCtr currCtr(void) const noexcept
Get the current value of the down-counter of a time event.
Definition: qf_time.cpp:447
QActive * toActive(void) noexcept
encapsulate the cast the m_act attribute to QActive*
Definition: qf.hpp:758
QTimeEvtCtr volatile m_ctr
the internal down-counter of the time event
Definition: qf.hpp:628
QTimeEvt * toTimeEvt(void) noexcept
encapsulate the cast the m_act attribute to QTimeEvt*
Definition: qf.hpp:763
QTimeEvtCtr m_interval
the interval for the periodic time event (zero for the one-shot time event)
Definition: qf.hpp:637
QTimeEvt(void) noexcept
private default constructor only for friends
Definition: qf_time.cpp:227
QTimeEvt *volatile m_next
link to the next time event in the list
Definition: qf.hpp:613
QTimeEvt(QTimeEvt const &)=delete
private copy constructor to disallow copying of QTimeEvts
void armX(QTimeEvtCtr const nTicks, QTimeEvtCtr const interval=0U) noexcept
Arm a time event (one shot or periodic) for event posting.
Definition: qf_time.cpp:258
bool disarm(void) noexcept
Disarm a time event.
Definition: qf_time.cpp:320
bool wasDisarmed(void) noexcept
Check the "was disarmed" status of a time event.
Definition: qf_time.cpp:427
bool rearm(QTimeEvtCtr const nTicks) noexcept
Rearm a time event.
Definition: qf_time.cpp:363
QTimeEvt & operator=(QTimeEvt const &)=delete
private assignment operator to disallow assigning of QTimeEvts
void *volatile m_act
the active object that receives the time events
Definition: qf.hpp:620
QXK preemptive, dual-mode (blocking/non-blocking) real-time kernel.
Definition: qxk.hpp:158
Priority Ceiling Mutex the QXK preemptive kernel.
Definition: qxthread.hpp:427
Counting Semaphore of the QXK preemptive kernel.
Definition: qxthread.hpp:298
Extended (blocking) thread of the QXK preemptive kernel.
Definition: qxthread.hpp:59
namespace associated with the QP/C++ framework
Definition: exa_native.dox:1
std::uint_fast16_t const QF_NO_MARGIN
special value of margin that causes asserting failure in case event allocation or event posting fails
Definition: qf.hpp:1211
QMState const * obj
pointer to QMState object
Definition: qep.hpp:233
constexpr char const versionStr[]
the current QP version number string based on QP_VERSION_STR
Definition: qep.hpp:122
QState(*)(void *const me, QEvt const *const e) QStateHandler
Pointer to state-handler function.
Definition: qep.hpp:216
std::uint16_t QEvtSize
The data type to store the block-size defined based on the macro #QF_EVENT_SIZ_SIZE.
Definition: qf.hpp:82
std::uint32_t QTimeEvtCtr
Definition: qf.hpp:104
State object for the QP::QMsm class (QM State Machine).
Definition: qep.hpp:780
int enum_t
alias for enumerations used for event signals
Definition: qep.hpp:67
int int_t
alias for line numbers in assertions and return from QF::run()
Definition: qep.hpp:64
#define QF_THREAD_TYPE
Definition: qk.hpp:48
platform-independent priority sets of 8 or 64 elements.
#define QF_MAX_TICK_RATE
#define QF_MAX_ACTIVE
#define QF_EQUEUE_TYPE
Definition: qv.hpp:42
void QXK_activate_(void)
QXK activator activates the next active object.
Definition: qxk.cpp:319
#define QF_OS_OBJECT_TYPE
Definition: qxk.hpp:48
QEvt base class.
Definition: qep.hpp:155
Priority Set of up to 64 elements.
Definition: qpset.hpp:133