QP/C  8.0.0
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 7.0.0 <www.state-machine.com/qm>.
7// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
8//
9// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
10//
11// Q u a n t u m L e a P s
12// ------------------------
13// Modern Embedded Software
14//
15// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
16//
17// The QP/C software is dual-licensed under the terms of the open-source GNU
18// General Public License (GPL) or under the terms of one of the closed-
19// source Quantum Leaps commercial licenses.
20//
21// Redistributions in source code must retain this top-level comment block.
22// Plagiarizing this software to sidestep the license obligations is illegal.
23//
24// NOTE:
25// The GPL does NOT permit the incorporation of this code into proprietary
26// programs. Please contact Quantum Leaps for commercial licensing options,
27// which expressly supersede the GPL and are designed explicitly for
28// closed-source distribution.
29//
30// Quantum Leaps contact information:
31// <www.state-machine.com/licensing>
32// <info@state-machine.com>
33//
34//$endhead${src::qf::qf_qmact.c} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
35#define QP_IMPL // this is QP implementation
36#include "qp_port.h" // QP port
37#include "qp_pkg.h" // QP package-scope interface
38#include "qsafe.h" // QP Functional Safety (FuSa) Subsystem
39#ifdef Q_SPY // QS software tracing enabled?
40 #include "qs_port.h" // QS port
41 #include "qs_pkg.h" // QS facilities for pre-defined trace records
42#else
43 #include "qs_dummy.h" // disable the QS software tracing
44#endif // Q_SPY
45
46//Q_DEFINE_THIS_MODULE("qf_qmact")
47
48//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
49// Check for the minimum required QP version
50#if (QP_VERSION < 730U) || (QP_VERSION != ((QP_RELEASE^4294967295U)%0x2710U))
51#error qpc version 7.3.0 or higher required
52#endif
53//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
54//$define${QF::QMActive} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
55
56//${QF::QMActive} ............................................................
57
58//${QF::QMActive::ctor} ......................................................
59//! @protected @memberof QMActive
60void QMActive_ctor(QMActive * const me,
61 QStateHandler const initial)
62{
63 // clear the whole QMActive object, so that the framework can start
64 // correctly even if the startup code fails to clear the uninitialized
65 // data (as is required by the C Standard).
66 QF_bzero_(me, sizeof(*me));
67
68 // NOTE: QActive inherits the QActvie class, but it calls the
69 // constructor of the QMsm subclass. This is because QMActive inherits
70 // the behavior from the QMsm subclass.
71 QMsm_ctor((QMsm *)(me), initial);
72
73 // NOTE: this vtable is identical as QMsm, but is provided
74 // for the QMActive subclass to provide a UNIQUE vptr to distinguish
75 // subclasses of QActive (e.g., in the debugger).
76 static struct QAsmVtable const vtable = { // QMActive virtual table
77 &QMsm_init_,
78 &QMsm_dispatch_,
79 &QMsm_isIn_
80 #ifdef Q_SPY
81 ,&QMsm_getStateHandler_
82 #endif
83 };
84 me->super.super.vptr = &vtable; // hook vptr to QMActive vtable
85}
86//$enddef${QF::QMActive} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
QState(* QStateHandler)(void *const me, QEvt const *const e)
Pointer to a state-handler function.
Definition qp.h:215
Internal (package scope) QP/C interface.
Sample QP/C port.
Sample QS/C port.
QP Functional Safety (FuSa) Subsystem.
QAsm super
Definition qp.h:777
struct QAsmVtable const * vptr
Virtual pointer inherited by all QAsm subclasses (see also Object Orientation)
Definition qp.h:260
Virtual table for the QAsm class.
Definition qp.h:277
Active object class (based on QMsm implementation strategy)
Definition qp.h:925
QActive super
Definition qp.h:927
Hierarchical State Machine class (QMsm-style state machine implementation strategy)
Definition qp.h:355