QP/C++  7.3.3
Real-Time Embedded Framework
Loading...
Searching...
No Matches
qep_msm.cpp
Go to the documentation of this file.
1//$file${src::qf::qep_msm.cpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
2//
3// Model: qpcpp.qm
4// File: ${src::qf::qep_msm.cpp}
5//
6// This code has been generated by QM 6.1.1 <www.state-machine.com/qm>.
7// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
8//
9// This code is covered by the following QP license:
10// License # : LicenseRef-QL-dual
11// Issued to : Any user of the QP/C++ real-time embedded framework
12// Framework(s) : qpcpp
13// Support ends : 2024-12-31
14// License scope:
15//
16// Copyright (C) 2005 Quantum Leaps, LLC <state-machine.com>.
17//
18// Q u a n t u m L e a P s
19// ------------------------
20// Modern Embedded Software
21//
22// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
23//
24// This software is dual-licensed under the terms of the open source GNU
25// General Public License version 3 (or any later version), or alternatively,
26// under the terms of one of the closed source Quantum Leaps commercial
27// licenses.
28//
29// The terms of the open source GNU General Public License version 3
30// can be found at: <www.gnu.org/licenses/gpl-3.0>
31//
32// The terms of the closed source Quantum Leaps commercial licenses
33// can be found at: <www.state-machine.com/licensing>
34//
35// Redistributions in source code must retain this top-level comment block.
36// Plagiarizing this software to sidestep the license obligations is illegal.
37//
38// Contact information:
39// <www.state-machine.com/licensing>
40// <info@state-machine.com>
41//
42//$endhead${src::qf::qep_msm.cpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43#define QP_IMPL // this is QP implementation
44#include "qp_port.hpp" // QP port
45#include "qp_pkg.hpp" // QP package-scope interface
46#include "qsafe.h" // QP Functional Safety (FuSa) Subsystem
47#ifdef Q_SPY // QS software tracing enabled?
48 #include "qs_port.hpp" // QS port
49 #include "qs_pkg.hpp" // QS facilities for pre-defined trace records
50#else
51 #include "qs_dummy.hpp" // disable the QS software tracing
52#endif // Q_SPY
53
54//============================================================================
55//! @cond INTERNAL
56
57// unnamed namespace for local definitions with internal linkage
58namespace {
59
60Q_DEFINE_THIS_MODULE("qep_msm")
61
62// maximum depth of state nesting in a QMsm (including the top level)
63static constexpr std::int_fast8_t MAX_NEST_DEPTH_ {6};
64
65// maximum length of transition-action array
66static constexpr std::int_fast8_t MAX_TRAN_LENGTH_ {3*MAX_NEST_DEPTH_};
67
68// maximum depth of entry levels in a MSM for tran. to history.
69static constexpr std::int_fast8_t MAX_ENTRY_DEPTH_ {4};
70
71// top-state object for QMsm-style state machines
72QP::QMState const l_msm_top_s = {
73 nullptr,
74 nullptr,
75 nullptr,
76 nullptr,
77 nullptr
78};
79
80} // unnamed namespace
81
82//! @endcond
83//============================================================================
84
85//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
86// Check for the minimum required QP version
87#if (QP_VERSION < 730U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
88#error qpcpp version 7.3.0 or higher required
89#endif
90//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
91
92//$define${QEP::QMsm} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
93namespace QP {
94
95//${QEP::QMsm} ...............................................................
96
97//${QEP::QMsm::QMsm} .........................................................
98QMsm::QMsm(QStateHandler const initial) noexcept
99 : QAsm()
100{
101 m_state.obj = &l_msm_top_s; // the current state (top)
102 m_temp.fun = initial; // the initial tran. handler
103}
104
105//${QEP::QMsm::init} .........................................................
107 void const * const e,
108 std::uint_fast8_t const qsId)
109{
110 #ifndef Q_SPY
111 Q_UNUSED_PAR(qsId);
112 #endif
113
116 Q_REQUIRE_INCRIT(200, (m_temp.fun != nullptr)
117 && (m_state.obj == &l_msm_top_s));
118 QF_CRIT_EXIT();
119
120 // execute the top-most initial tran.
121 QState r = (*m_temp.fun)(this, Q_EVT_CAST(QEvt));
122
124 // the top-most initial tran. must be taken
126
127 QS_MEM_SYS();
128 QS_BEGIN_PRE_(QS_QEP_STATE_INIT, qsId)
129 QS_OBJ_PRE_(this); // this state machine object
130 QS_FUN_PRE_(m_state.obj->stateHandler); // source state
131 QS_FUN_PRE_(m_temp.tatbl->target->stateHandler); // target state
132 QS_END_PRE_()
133 QS_MEM_APP();
134
135 QF_CRIT_EXIT();
136
137 // set state to the last tran. target
139
140 // drill down into the state hierarchy with initial transitions...
141 std::int_fast8_t limit = MAX_NEST_DEPTH_; // loop hard limit
142 do {
143 // execute the tran. table
144 r = execTatbl_(m_temp.tatbl, qsId);
145 --limit;
146 } while ((r >= Q_RET_TRAN_INIT) && (limit > 0));
147
149 Q_ENSURE_INCRIT(290, limit > 0);
150
151 QS_MEM_SYS();
152 QS_BEGIN_PRE_(QS_QEP_INIT_TRAN, qsId)
153 QS_TIME_PRE_(); // time stamp
154 QS_OBJ_PRE_(this); // this state machine object
155 QS_FUN_PRE_(m_state.obj->stateHandler); // the new current state
156 QS_END_PRE_()
157 QS_MEM_APP();
158
159 QF_CRIT_EXIT();
160
161 #ifndef Q_UNSAFE
162 m_temp.uint = ~m_state.uint;
163 #endif
164}
165
166//${QEP::QMsm::dispatch} .....................................................
168 QEvt const * const e,
169 std::uint_fast8_t const qsId)
170{
171 #ifndef Q_SPY
172 Q_UNUSED_PAR(qsId);
173 #endif
174
175 QMState const *s = m_state.obj; // store the current state
176 QMState const *t = s;
177
180 Q_REQUIRE_INCRIT(300, (s != nullptr)
181 && (m_state.uint == static_cast<std::uintptr_t>(~m_temp.uint)));
183
184 QS_MEM_SYS();
185 QS_BEGIN_PRE_(QS_QEP_DISPATCH, qsId)
186 QS_TIME_PRE_(); // time stamp
187 QS_SIG_PRE_(e->sig); // the signal of the event
188 QS_OBJ_PRE_(this); // this state machine object
189 QS_FUN_PRE_(s->stateHandler); // the current state handler
190 QS_END_PRE_()
191 QS_MEM_APP();
192
193 QF_CRIT_EXIT();
194
195 // scan the state hierarchy up to the top state...
196 QState r;
197 std::int_fast8_t limit = MAX_NEST_DEPTH_; // loop hard limit
198 do {
199 r = (*t->stateHandler)(this, e); // call state handler function
200
201 // event handled? (the most frequent case)
202 if (r >= Q_RET_HANDLED) {
203 break; // done scanning the state hierarchy
204 }
205 // event unhandled and passed to the superstate?
206 else if (r == Q_RET_SUPER) {
207 t = t->superstate; // advance to the superstate
208 }
209 // event unhandled and passed to a submachine superstate?
210 else if (r == Q_RET_SUPER_SUB) {
211 t = m_temp.obj; // current host state of the submachie
212 }
213 else { // event unhandled due to a guard?
215 // event must be unhandled due to a guard evaluating to 'false'
217
218 QS_MEM_SYS();
219 QS_BEGIN_PRE_(QS_QEP_UNHANDLED, qsId)
220 QS_SIG_PRE_(e->sig); // the signal of the event
221 QS_OBJ_PRE_(this); // this state machine object
222 QS_FUN_PRE_(t->stateHandler); // the current state
223 QS_END_PRE_()
224 QS_MEM_APP();
225
226 QF_CRIT_EXIT();
227
228 t = t->superstate; // advance to the superstate
229 }
230 --limit;
231 } while ((t != nullptr) && (limit > 0));
233 Q_ASSERT_INCRIT(310, limit > 0);
234 QF_CRIT_EXIT();
235
236 if (r >= Q_RET_TRAN) { // any kind of tran. taken?
237 #ifdef Q_SPY
238 QMState const * const ts = t; // tran. source for QS tracing
239
241 // the tran. source state must not be nullptr
242 Q_ASSERT_INCRIT(320, ts != nullptr);
243 QF_CRIT_EXIT();
244 #endif // Q_SPY
245
246 limit = MAX_NEST_DEPTH_; // loop hard limit
247 do {
248 // save the tran-action table before it gets clobbered
249 QMTranActTable const * const tatbl = m_temp.tatbl;
250 QAsmAttr tmp; // temporary to save intermediate values
251
252 // was TRAN, TRAN_INIT, or TRAN_EP taken?
253 if (r <= Q_RET_TRAN_EP) {
254 m_temp.obj = nullptr; // clear
255 exitToTranSource_(s, t, qsId);
256 r = execTatbl_(tatbl, qsId);
257 s = m_state.obj;
258 }
259 // was a tran. segment to history taken?
260 else if (r == Q_RET_TRAN_HIST) {
261 tmp.obj = m_state.obj; // save history
262 m_state.obj = s; // restore the original state
263 exitToTranSource_(s, t, qsId);
264 static_cast<void>(execTatbl_(tatbl, qsId));
265 r = enterHistory_(tmp.obj, qsId);
266 s = m_state.obj;
267 }
268 else {
270 // must be tran. to exit point
272 QF_CRIT_EXIT();
273
274 tmp.act = m_state.act; // save XP action
275 m_state.obj = s; // restore the original state
276 r = (*tmp.act)(this); // execute the XP action
277 if (r == Q_RET_TRAN) { // XP -> TRAN ?
278 #ifdef Q_SPY
279 tmp.tatbl = m_temp.tatbl; // save m_temp
280 #endif // Q_SPY
281 exitToTranSource_(s, t, qsId);
282 // take the tran-to-XP segment inside submachine
283 static_cast<void>(execTatbl_(tatbl, qsId));
284 s = m_state.obj;
285 #ifdef Q_SPY
286 m_temp.tatbl = tmp.tatbl; // restore m_temp
287 #endif // Q_SPY
288 }
289 else if (r == Q_RET_TRAN_HIST) { // XP -> HIST ?
290 tmp.obj = m_state.obj; // save the history
291 m_state.obj = s; // restore the original state
292 #ifdef Q_SPY
293 s = m_temp.obj; // save m_temp
294 #endif // Q_SPY
295 exitToTranSource_(m_state.obj, t, qsId);
296 // take the tran-to-XP segment inside submachine
297 static_cast<void>(execTatbl_(tatbl, qsId));
298 #ifdef Q_SPY
299 m_temp.obj = s; // restore m_temp
300 #endif // Q_SPY
301 s = m_state.obj;
302 m_state.obj = tmp.obj; // restore the history
303 }
304 else {
306 // TRAN_XP must NOT be followed by any other tran type
307 Q_ASSERT_INCRIT(330, r < Q_RET_TRAN);
308 QF_CRIT_EXIT();
309 }
310 }
311
312 t = s; // set target to the current state
313 --limit;
314 } while ((r >= Q_RET_TRAN) && (limit > 0));
315
317 Q_ASSERT_INCRIT(320, limit > 0);
318
319 QS_MEM_SYS();
320 QS_BEGIN_PRE_(QS_QEP_TRAN, qsId)
321 QS_TIME_PRE_(); // time stamp
322 QS_SIG_PRE_(e->sig); // the signal of the event
323 QS_OBJ_PRE_(this); // this state machine object
324 QS_FUN_PRE_(ts->stateHandler); // the tran. source
325 QS_FUN_PRE_(s->stateHandler); // the new active state
326 QS_END_PRE_()
327 QS_MEM_APP();
328
329 QF_CRIT_EXIT();
330 }
331
332 #ifdef Q_SPY
333 // was the event handled?
334 else if (r == Q_RET_HANDLED) {
336 // internal tran. source can't be nullptr
337 Q_ASSERT_INCRIT(340, t != nullptr);
338
339 QS_MEM_SYS();
340 QS_BEGIN_PRE_(QS_QEP_INTERN_TRAN, qsId)
341 QS_TIME_PRE_(); // time stamp
342 QS_SIG_PRE_(e->sig); // the signal of the event
343 QS_OBJ_PRE_(this); // this state machine object
344 QS_FUN_PRE_(t->stateHandler); // the source state
345 QS_END_PRE_()
346 QS_MEM_APP();
347
348 QF_CRIT_EXIT();
349 }
350 // event bubbled to the 'top' state?
351 else if (t == nullptr) {
353 QS_MEM_SYS();
354 QS_BEGIN_PRE_(QS_QEP_IGNORED, qsId)
355 QS_TIME_PRE_(); // time stamp
356 QS_SIG_PRE_(e->sig); // the signal of the event
357 QS_OBJ_PRE_(this); // this state machine object
358 QS_FUN_PRE_(s->stateHandler); // the current state
359 QS_END_PRE_()
360 QS_MEM_APP();
361 QS_CRIT_EXIT();
362 }
363 #endif // Q_SPY
364 else {
365 // empty
366 }
367
368 #ifndef Q_UNSAFE
369 m_temp.uint = ~m_state.uint;
370 #endif
371}
372
373//${QEP::QMsm::isIn} .........................................................
374bool QMsm::isIn(QStateHandler const state) noexcept {
375 bool inState = false; // assume that this SM is not in 'state'
376
377 QMState const *s = m_state.obj;
378 std::int_fast8_t limit = MAX_NEST_DEPTH_; // loop hard limit
379 for (; (s != nullptr) && (limit > 0); --limit) {
380 if (s->stateHandler == state) { // match found?
381 inState = true;
382 break;
383 }
384 else {
385 s = s->superstate; // advance to the superstate
386 }
387 }
388
391 Q_ENSURE_INCRIT(490, limit > 0);
392 QF_CRIT_EXIT();
393
394 return inState;
395}
396
397//${QEP::QMsm::isInState} ....................................................
398bool QMsm::isInState(QMState const * const stateObj) const noexcept {
399 bool inState = false; // assume that this SM is not in 'state'
400
401 QMState const *s = m_state.obj;
402 std::int_fast8_t limit = MAX_NEST_DEPTH_; // loop hard limit
403 for (; (s != nullptr) && (limit > 0); --limit) {
404 if (s == stateObj) { // match found?
405 inState = true;
406 break;
407 }
408 else {
409 s = s->superstate; // advance to the superstate
410 }
411 }
412
415 Q_ENSURE_INCRIT(590, limit > 0);
416 QF_CRIT_EXIT();
417
418 return inState;
419}
420
421//${QEP::QMsm::childStateObj} ................................................
422QMState const * QMsm::childStateObj(QMState const * const parent) const noexcept {
423 QMState const *child = m_state.obj;
424 bool isFound = false; // start with the child not found
425 QMState const *s;
426
427 std::int_fast8_t limit = MAX_NEST_DEPTH_; // loop hard limit
428 for (s = m_state.obj;
429 (s != nullptr) && (limit > 0);
430 s = s->superstate)
431 {
432 if (s == parent) {
433 isFound = true; // child is found
434 break;
435 }
436 else {
437 child = s;
438 }
439 --limit;
440 }
443 Q_ASSERT_INCRIT(610, limit > 0);
444 QF_CRIT_EXIT();
445
446 if (!isFound) { // still not found?
447 limit = MAX_NEST_DEPTH_; // loop hard limit
448 for (s = m_temp.obj;
449 (s != nullptr) && (limit > 0);
450 s = s->superstate)
451 {
452 if (s == parent) {
453 isFound = true; // child is found
454 break;
455 }
456 else {
457 child = s;
458 }
459 --limit;
460 }
461 }
462
464 Q_ENSURE_INCRIT(690, isFound && (limit > 0));
465 QF_CRIT_EXIT();
466
467 return child; // return the child
468}
469
470//${QEP::QMsm::execTatbl_} ...................................................
472 QMTranActTable const * const tatbl,
473 std::uint_fast8_t const qsId)
474{
475 #ifndef Q_SPY
476 Q_UNUSED_PAR(qsId);
477 #endif
478
481 // precondition:
482 // - the tran-action table pointer must not be NULL
483 Q_REQUIRE_INCRIT(700, tatbl != nullptr);
484 QF_CRIT_EXIT();
485
486 QState r = Q_RET_NULL;
487 std::int_fast8_t limit = MAX_TRAN_LENGTH_; // loop hard limit
488 QActionHandler const *a = &tatbl->act[0];
489 for (; (*a != nullptr) && (limit > 0); ++a) {
490 r = (*(*a))(this); // call the action through the 'a' pointer
491 #ifdef Q_SPY
493 QS_MEM_SYS();
494 if (r == Q_RET_ENTRY) {
495 QS_BEGIN_PRE_(QS_QEP_STATE_ENTRY, qsId)
496 QS_OBJ_PRE_(this); // this state machine object
497 QS_FUN_PRE_(m_temp.obj->stateHandler); // entered state
498 QS_END_PRE_()
499 }
500 else if (r == Q_RET_EXIT) {
501 QS_BEGIN_PRE_(QS_QEP_STATE_EXIT, qsId)
502 QS_OBJ_PRE_(this); // this state machine object
503 QS_FUN_PRE_(m_temp.obj->stateHandler); // exited state
504 QS_END_PRE_()
505 }
506 else if (r == Q_RET_TRAN_INIT) {
507 QS_BEGIN_PRE_(QS_QEP_STATE_INIT, qsId)
508 QS_OBJ_PRE_(this); // this state machine object
509 QS_FUN_PRE_(tatbl->target->stateHandler); // source
510 QS_FUN_PRE_(m_temp.tatbl->target->stateHandler); // target
511 QS_END_PRE_()
512 }
513 else if (r == Q_RET_TRAN_EP) {
514 QS_BEGIN_PRE_(QS_QEP_TRAN_EP, qsId)
515 QS_OBJ_PRE_(this); // this state machine object
516 QS_FUN_PRE_(tatbl->target->stateHandler); // source
517 QS_FUN_PRE_(m_temp.tatbl->target->stateHandler); // target
518 QS_END_PRE_()
519 }
520 else if (r == Q_RET_TRAN_XP) {
521 QS_BEGIN_PRE_(QS_QEP_TRAN_XP, qsId)
522 QS_OBJ_PRE_(this); // this state machine object
523 QS_FUN_PRE_(tatbl->target->stateHandler); // source
524 QS_FUN_PRE_(m_temp.tatbl->target->stateHandler); // target
525 QS_END_PRE_()
526 }
527 else {
528 // empty
529 }
530 QS_MEM_APP();
531 QS_CRIT_EXIT();
532 #endif // Q_SPY
533 --limit;
534 }
536 Q_ENSURE_INCRIT(790, *a == nullptr);
537 QF_CRIT_EXIT();
538
539 m_state.obj = (r >= Q_RET_TRAN)
541 : tatbl->target;
542 return r;
543}
544
545//${QEP::QMsm::exitToTranSource_} ............................................
547 QMState const * const cs,
548 QMState const * const ts,
549 std::uint_fast8_t const qsId)
550{
551 #ifndef Q_SPY
552 Q_UNUSED_PAR(qsId);
553 #endif
554
556
557 // exit states from the current state to the tran. source state
558 QMState const *s = cs;
559 std::int_fast8_t limit = MAX_NEST_DEPTH_; // loop hard limit
560 for (; (s != ts) && (limit > 0); --limit) {
561 // exit action provided in state 's'?
562 if (s->exitAction != nullptr) {
563 // execute the exit action
564 static_cast<void>((*s->exitAction)(this));
565
567 QS_MEM_SYS();
568 QS_BEGIN_PRE_(QS_QEP_STATE_EXIT, qsId)
569 QS_OBJ_PRE_(this); // this state machine object
570 QS_FUN_PRE_(s->stateHandler); // the exited state handler
571 QS_END_PRE_()
572 QS_MEM_APP();
573 QS_CRIT_EXIT();
574 }
575
576 s = s->superstate; // advance to the superstate
577
578 if (s == nullptr) { // reached the top of a submachine?
579 s = m_temp.obj; // the superstate from QM_SM_EXIT()
581 Q_ASSERT_INCRIT(810, s != nullptr); // must be valid
582 QF_CRIT_EXIT();
583 }
584 }
586 Q_ENSURE_INCRIT(890, limit > 0);
587 QF_CRIT_EXIT();
588}
589
590//${QEP::QMsm::enterHistory_} ................................................
592 QMState const * const hist,
593 std::uint_fast8_t const qsId)
594{
595 #ifndef Q_SPY
596 Q_UNUSED_PAR(qsId);
597 #endif
598
599 QMState const *s = hist;
600 QMState const *ts = m_state.obj; // tran. source
601 QMState const *epath[MAX_ENTRY_DEPTH_];
602
604
606 QS_MEM_SYS();
607 QS_BEGIN_PRE_(QS_QEP_TRAN_HIST, qsId)
608 QS_OBJ_PRE_(this); // this state machine object
609 QS_FUN_PRE_(ts->stateHandler); // source state handler
610 QS_FUN_PRE_(hist->stateHandler); // target state handler
611 QS_END_PRE_()
612 QS_MEM_APP();
613 QS_CRIT_EXIT();
614
615 std::int_fast8_t i = 0; // tran. entry path index
616 while ((s != ts) && (i < MAX_ENTRY_DEPTH_)) {
617 if (s->entryAction != nullptr) {
618 epath[i] = s;
619 ++i;
620 }
621 s = s->superstate;
622 if (s == nullptr) {
623 ts = s; // force exit from the for-loop
624 }
625 }
627 Q_ASSERT_INCRIT(910, s == ts);
628 QF_CRIT_EXIT();
629
630 // retrace the entry path in reverse (desired) order...
631 while (i > 0) {
632 --i;
633 (*epath[i]->entryAction)(this); // run entry action in epath[i]
634
636 QS_MEM_SYS();
637 QS_BEGIN_PRE_(QS_QEP_STATE_ENTRY, qsId)
638 QS_OBJ_PRE_(this);
639 QS_FUN_PRE_(epath[i]->stateHandler); // entered state handler
640 QS_END_PRE_()
641 QS_MEM_APP();
642 QS_CRIT_EXIT();
643 }
644
645 m_state.obj = hist; // set current state to the tran. target
646
647 // initial tran. present?
648 QState r;
649 if (hist->initAction != nullptr) {
650 r = (*hist->initAction)(this); // execute the tran. action
651 }
652 else {
653 r = Q_RET_NULL;
654 }
655
656 return r;
657}
658
659//${QEP::QMsm::topQMState} ...................................................
660QMState const * QMsm::topQMState() const noexcept {
661 return &l_msm_top_s;
662}
663
664} // namespace QP
665//$enddef${QEP::QMsm} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Abstract State Machine class (state machine interface)
Definition qp.hpp:220
QAsmAttr m_state
Definition qp.hpp:222
@ Q_RET_HANDLED
event handled (internal transition)
Definition qp.hpp:237
@ Q_RET_ENTRY
state entry action executed
Definition qp.hpp:241
@ Q_RET_UNHANDLED
event unhandled due to a guard
Definition qp.hpp:234
@ Q_RET_TRAN
regular transition
Definition qp.hpp:248
@ Q_RET_TRAN_HIST
transition to history of a given state
Definition qp.hpp:253
@ Q_RET_TRAN_XP
exit-point transition out of a submachine
Definition qp.hpp:254
@ Q_RET_SUPER_SUB
event passed to submachine superstate
Definition qp.hpp:233
@ Q_RET_NULL
return value without any effect
Definition qp.hpp:245
@ Q_RET_TRAN_INIT
initial transition in a state or submachine
Definition qp.hpp:249
@ Q_RET_TRAN_EP
entry-point transition into a submachine
Definition qp.hpp:250
@ Q_RET_EXIT
state exit action executed
Definition qp.hpp:242
@ Q_RET_SUPER
event passed to superstate to handle
Definition qp.hpp:232
QAsmAttr m_temp
Definition qp.hpp:223
Event class.
Definition qp.hpp:139
static bool verify_(QEvt const *const e) noexcept
Definition qp.hpp:163
QSignal sig
Definition qp.hpp:141
void exitToTranSource_(QMState const *const cs, QMState const *const ts, std::uint_fast8_t const qsId)
Definition qep_msm.cpp:546
QState enterHistory_(QMState const *const hist, std::uint_fast8_t const qsId)
Definition qep_msm.cpp:591
bool isIn(QStateHandler const state) noexcept override
Definition qep_msm.cpp:374
QMsm(QStateHandler const initial) noexcept
Definition qep_msm.cpp:98
void dispatch(QEvt const *const e, std::uint_fast8_t const qsId) override
Definition qep_msm.cpp:167
bool isInState(QMState const *const stateObj) const noexcept
Definition qep_msm.cpp:398
void init(void const *const e, std::uint_fast8_t const qsId) override
Definition qep_msm.cpp:106
QMState const * topQMState() const noexcept
Definition qep_msm.cpp:660
QMState const * childStateObj(QMState const *const parent) const noexcept
Definition qep_msm.cpp:422
QState execTatbl_(QMTranActTable const *const tatbl, std::uint_fast8_t const qsId)
Definition qep_msm.cpp:471
QP/C++ framework.
Definition qequeue.hpp:50
QState(*)(void *const me) QActionHandler
Definition qp.hpp:179
QState(*)(void *const me, QEvt const *const e) QStateHandler
Definition qp.hpp:176
std::uint_fast8_t QState
Definition qp.hpp:173
@ QS_QEP_DISPATCH
an event was dispatched (begin of RTC step)
Definition qs.hpp:81
@ QS_QEP_STATE_ENTRY
a state was entered
Definition qs.hpp:74
@ QS_QEP_STATE_EXIT
a state was exited
Definition qs.hpp:75
@ QS_QEP_TRAN_HIST
a tran to history was taken
Definition qs.hpp:154
@ QS_QEP_IGNORED
an event was ignored (silently discarded)
Definition qs.hpp:80
@ QS_QEP_UNHANDLED
an event was un-handled due to a guard
Definition qs.hpp:82
@ QS_QEP_TRAN_XP
a tran to exit point out of a submachine
Definition qs.hpp:156
@ QS_QEP_TRAN_EP
a tran to entry point into a submachine
Definition qs.hpp:155
@ QS_QEP_STATE_INIT
an initial transition was taken in a state
Definition qs.hpp:76
@ QS_QEP_TRAN
a regular transition was taken
Definition qs.hpp:79
@ QS_QEP_INIT_TRAN
the top-most initial transition was taken
Definition qs.hpp:77
@ QS_QEP_INTERN_TRAN
an internal transition was taken
Definition qs.hpp:78
#define Q_EVT_CAST(subclass_)
Definition qp.hpp:490
#define Q_UNUSED_PAR(par_)
Definition qp.hpp:541
Internal (package scope) QP/C++ interface.
Sample QP/C++ port.
#define QS_TIME_PRE_()
Definition qs.hpp:473
#define QS_MEM_APP()
Definition qs.hpp:610
#define QS_CRIT_EXIT()
Definition qs.hpp:600
#define QS_MEM_SYS()
Definition qs.hpp:605
#define QS_CRIT_ENTRY()
Definition qs.hpp:595
QS/C++ package-scope interface.
QS/C++ port to a 32-bit CPU, generic C++ compiler.
QP Functional Safety (FuSa) Subsystem.
#define QF_CRIT_ENTRY()
Definition qsafe.h:58
#define Q_ASSERT_INCRIT(id_, expr_)
Definition qsafe.h:72
#define Q_ENSURE_INCRIT(id_, expr_)
Definition qsafe.h:145
#define QF_CRIT_EXIT()
Definition qsafe.h:62
#define Q_REQUIRE_INCRIT(id_, expr_)
Definition qsafe.h:136
#define QF_CRIT_STAT
Definition qsafe.h:54
State object for the QP::QMsm class (QM State Machine).
Definition qp.hpp:189
QActionHandler const entryAction
Definition qp.hpp:192
QStateHandler const stateHandler
Definition qp.hpp:191
QMState const * superstate
Definition qp.hpp:190
QActionHandler const initAction
Definition qp.hpp:194
Transition-Action Table for the QP::QMsm State Machine.
Definition qp.hpp:198
QMState const * target
Definition qp.hpp:199
QActionHandler const act[1]
Definition qp.hpp:200
Attribute of for the QP::QAsm class (Abstract State Machine).
Definition qp.hpp:204
std::uintptr_t uint
Definition qp.hpp:211
QMState const * obj
Definition qp.hpp:208
QStateHandler fun
Definition qp.hpp:205
QMTranActTable const * tatbl
Definition qp.hpp:209
QActionHandler act
Definition qp.hpp:206