QP/C  7.4.0-rc.3
Real-Time Embedded Framework
Loading...
Searching...
No Matches
qf_qmact.c
Go to the documentation of this file.
1//$file${src::qf::qf_qmact.c} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
2//
3// Model: qpc.qm
4// File: ${src::qf::qf_qmact.c}
5//
6// This code has been generated by QM 6.2.0 <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) : qpc
13// Support ends : 2025-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::qf_qmact.c} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43#define QP_IMPL // this is QP implementation
44#include "qp_port.h" // QP port
45#include "qp_pkg.h" // 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.h" // QS port
49 #include "qs_pkg.h" // QS facilities for pre-defined trace records
50#else
51 #include "qs_dummy.h" // disable the QS software tracing
52#endif // Q_SPY
53
54//Q_DEFINE_THIS_MODULE("qf_qmact")
55
56//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
57// Check for the minimum required QP version
58#if (QP_VERSION < 730U) || (QP_VERSION != ((QP_RELEASE^4294967295U)%0x2710U))
59#error qpc version 7.3.0 or higher required
60#endif
61//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
62//$define${QF::QMActive} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
63
64//${QF::QMActive} ............................................................
65
66//${QF::QMActive::ctor} ......................................................
67//! @protected @memberof QMActive
68void QMActive_ctor(QMActive * const me,
69 QStateHandler const initial)
70{
71 // clear the whole QMActive object, so that the framework can start
72 // correctly even if the startup code fails to clear the uninitialized
73 // data (as is required by the C Standard).
74 QF_bzero_(me, sizeof(*me));
75
76 // NOTE: QActive inherits the QActvie class, but it calls the
77 // constructor of the QMsm subclass. This is because QMActive inherits
78 // the behavior from the QMsm subclass.
79 QMsm_ctor((QMsm *)(me), initial);
80
81 // NOTE: this vtable is identical as QMsm, but is provided
82 // for the QMActive subclass to provide a UNIQUE vptr to distinguish
83 // subclasses of QActive (e.g., in the debugger).
84 static struct QAsmVtable const vtable = { // QMActive virtual table
85 &QMsm_init_,
86 &QMsm_dispatch_,
87 &QMsm_isIn_
88 #ifdef Q_SPY
89 ,&QMsm_getStateHandler_
90 #endif
91 };
92 me->super.super.vptr = &vtable; // hook vptr to QMActive vtable
93}
94//$enddef${QF::QMActive} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
QState(* QStateHandler)(void *const me, QEvt const *const e)
Pointer to a state-handler function.
Definition qp.h:229
Internal (package scope) QP/C interface.
Sample QP/C port.
QS/C package-scope interface.
Sample QS/C port.
QP Functional Safety (FuSa) Subsystem.
QAsm super
Definition qp.h:806
struct QAsmVtable const * vptr
Virtual pointer inherited by all QAsm subclasses (see also Object Orientation)
Definition qp.h:284
Virtual table for the QAsm class.
Definition qp.h:301
Active object class (based on QMsm implementation strategy)
Definition qp.h:956
QActive super
Definition qp.h:958
Hierarchical State Machine class (QMsm-style state machine implementation strategy)
Definition qp.h:379