686 lines
22 KiB
C++
Raw Normal View History

2013-12-30 17:41:15 -05:00
//****************************************************************************
// Model: qmsmtst.qm
// File: ./qmsmtst.cpp
//
// This code has been generated by QM tool (see state-machine.com/qm).
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// This program is open source software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License as published
// by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//****************************************************************************
2014-04-13 21:35:34 -04:00
//${.::qmsmtst.cpp} ..........................................................
2013-12-30 17:41:15 -05:00
#include "qp_port.h"
#include "qmsmtst.h"
namespace QMSMTST {
2014-04-13 21:35:34 -04:00
//${SMs::QMsmTst} ............................................................
2013-12-30 17:41:15 -05:00
class QMsmTst : public QP::QMsm {
private:
bool m_foo;
public:
QMsmTst()
: QMsm(Q_STATE_CAST(&initial))
2013-12-30 17:41:15 -05:00
{}
protected:
static QP::QState initial(QMsmTst * const me, QP::QEvt const * const e);
static QP::QState s (QMsmTst * const me, QP::QEvt const * const e);
static QP::QState s_e(QMsmTst * const me);
static QP::QState s_x(QMsmTst * const me);
static QP::QState s_i(QMsmTst * const me);
static QP::QMState const s_s;
static QP::QState s1 (QMsmTst * const me, QP::QEvt const * const e);
static QP::QState s1_e(QMsmTst * const me);
static QP::QState s1_x(QMsmTst * const me);
static QP::QState s1_i(QMsmTst * const me);
static QP::QMState const s1_s;
static QP::QState s11 (QMsmTst * const me, QP::QEvt const * const e);
static QP::QState s11_e(QMsmTst * const me);
static QP::QState s11_x(QMsmTst * const me);
static QP::QMState const s11_s;
static QP::QState s2 (QMsmTst * const me, QP::QEvt const * const e);
static QP::QState s2_e(QMsmTst * const me);
static QP::QState s2_x(QMsmTst * const me);
static QP::QState s2_i(QMsmTst * const me);
static QP::QMState const s2_s;
static QP::QState s21 (QMsmTst * const me, QP::QEvt const * const e);
static QP::QState s21_e(QMsmTst * const me);
static QP::QState s21_x(QMsmTst * const me);
static QP::QState s21_i(QMsmTst * const me);
static QP::QMState const s21_s;
static QP::QState s211 (QMsmTst * const me, QP::QEvt const * const e);
static QP::QState s211_e(QMsmTst * const me);
static QP::QState s211_x(QMsmTst * const me);
static QP::QMState const s211_s;
};
static QMsmTst l_msmtst; // the only instance of the QMsmTst class
// global-scope definitions -----------------------------------------
QP::QMsm * const the_msm = &l_msmtst; // the opaque pointer
2014-04-13 21:35:34 -04:00
//${SMs::QMsmTst} ............................................................
2013-12-30 17:41:15 -05:00
2014-04-13 21:35:34 -04:00
//${SMs::QMsmTst::SM} ........................................................
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::initial(QMsmTst * const me, QP::QEvt const * const e) {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[4];
} const tatbl_ = { // transition-action table
&s2_s,
{
Q_ACTION_CAST(&s_e), // entry
Q_ACTION_CAST(&s2_e), // entry
Q_ACTION_CAST(&s2_i), // initial tran.
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::initial}
2013-12-30 17:41:15 -05:00
(void)e; // avoid compiler warning
me->m_foo = 0U;
BSP_display("top-INIT;");
2014-04-13 21:35:34 -04:00
return QM_TRAN_INIT(&tatbl_);
2013-12-30 17:41:15 -05:00
}
2014-04-13 21:35:34 -04:00
//${SMs::QMsmTst::SM::s} .....................................................
2013-12-30 17:41:15 -05:00
QP::QMState const QMsmTst::s_s = {
2014-04-13 21:35:34 -04:00
static_cast<QP::QMState const *>(0), // superstate (top)
Q_STATE_CAST(&s),
Q_ACTION_CAST(&s_e),
Q_ACTION_CAST(&s_x),
Q_ACTION_CAST(&s_i)
2013-12-30 17:41:15 -05:00
};
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s_e(QMsmTst * const me) {
BSP_display("s-ENTRY;");
2014-04-13 21:35:34 -04:00
(void)me; // avoid compiler warning in case 'me' is not used
2013-12-30 17:41:15 -05:00
return QM_ENTRY(&s_s);
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s_x(QMsmTst * const me) {
BSP_display("s-EXIT;");
2014-04-13 21:35:34 -04:00
(void)me; // avoid compiler warning in case 'me' is not used
2013-12-30 17:41:15 -05:00
return QM_EXIT(&s_s);
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::initial}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s_i(QMsmTst * const me) {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[3];
} const tatbl_ = { // transition-action table
&s11_s,
{
Q_ACTION_CAST(&s1_e), // entry
Q_ACTION_CAST(&s11_e), // entry
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::initial}
2013-12-30 17:41:15 -05:00
BSP_display("s-INIT;");
2014-04-13 21:35:34 -04:00
return QM_TRAN_INIT(&tatbl_);
2013-12-30 17:41:15 -05:00
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s(QMsmTst * const me, QP::QEvt const * const e) {
QP::QState status_;
switch (e->sig) {
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::I}
2013-12-30 17:41:15 -05:00
case I_SIG: {
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::I::[me->m_foo]}
2013-12-30 17:41:15 -05:00
if (me->m_foo) {
me->m_foo = 0U;
BSP_display("s-I;");
status_ = QM_HANDLED();
}
else {
status_ = QM_UNHANDLED();
}
break;
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::E}
2013-12-30 17:41:15 -05:00
case E_SIG: {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[3];
} const tatbl_ = { // transition-action table
&s11_s,
{
Q_ACTION_CAST(&s1_e), // entry
Q_ACTION_CAST(&s11_e), // entry
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
BSP_display("s-E;");
2014-04-13 21:35:34 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:41:15 -05:00
break;
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::TERMINATE}
2013-12-30 17:41:15 -05:00
case TERMINATE_SIG: {
BSP_terminate(0);
status_ = QM_HANDLED();
break;
}
default: {
status_ = QM_SUPER();
break;
}
}
2014-04-13 21:35:34 -04:00
(void)me; /* avoid compiler warning in case 'me' is not used */
2013-12-30 17:41:15 -05:00
return status_;
}
2014-04-13 21:35:34 -04:00
//${SMs::QMsmTst::SM::s::s1} .................................................
2013-12-30 17:41:15 -05:00
QP::QMState const QMsmTst::s1_s = {
2014-04-13 21:35:34 -04:00
&QMsmTst::s_s, // superstate
Q_STATE_CAST(&s1),
Q_ACTION_CAST(&s1_e),
Q_ACTION_CAST(&s1_x),
Q_ACTION_CAST(&s1_i)
2013-12-30 17:41:15 -05:00
};
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s1_e(QMsmTst * const me) {
BSP_display("s1-ENTRY;");
2014-04-13 21:35:34 -04:00
(void)me; // avoid compiler warning in case 'me' is not used
2013-12-30 17:41:15 -05:00
return QM_ENTRY(&s1_s);
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s1_x(QMsmTst * const me) {
BSP_display("s1-EXIT;");
2014-04-13 21:35:34 -04:00
(void)me; // avoid compiler warning in case 'me' is not used
2013-12-30 17:41:15 -05:00
return QM_EXIT(&s1_s);
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1::initial}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s1_i(QMsmTst * const me) {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[2];
} const tatbl_ = { // transition-action table
&s11_s,
{
Q_ACTION_CAST(&s11_e), // entry
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1::initial}
2013-12-30 17:41:15 -05:00
BSP_display("s1-INIT;");
2014-04-13 21:35:34 -04:00
return QM_TRAN_INIT(&tatbl_);
2013-12-30 17:41:15 -05:00
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s1(QMsmTst * const me, QP::QEvt const * const e) {
QP::QState status_;
switch (e->sig) {
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1::I}
2013-12-30 17:41:15 -05:00
case I_SIG: {
BSP_display("s1-I;");
status_ = QM_HANDLED();
break;
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1::D}
2013-12-30 17:41:15 -05:00
case D_SIG: {
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1::D::[!me->m_foo]}
2013-12-30 17:41:15 -05:00
if (!me->m_foo) {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[3];
} const tatbl_ = { // transition-action table
&s_s,
{
Q_ACTION_CAST(&s1_x), // exit
Q_ACTION_CAST(&s_i), // initial tran.
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
me->m_foo = true;
BSP_display("s1-D;");
2014-04-13 21:35:34 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:41:15 -05:00
}
else {
status_ = QM_UNHANDLED();
}
break;
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1::A}
2013-12-30 17:41:15 -05:00
case A_SIG: {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[4];
} const tatbl_ = { // transition-action table
&s1_s,
{
Q_ACTION_CAST(&s1_x), // exit
Q_ACTION_CAST(&s1_e), // entry
Q_ACTION_CAST(&s1_i), // initial tran.
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
BSP_display("s1-A;");
2014-04-13 21:35:34 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:41:15 -05:00
break;
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1::B}
2013-12-30 17:41:15 -05:00
case B_SIG: {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[2];
} const tatbl_ = { // transition-action table
&s11_s,
{
Q_ACTION_CAST(&s11_e), // entry
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
BSP_display("s1-B;");
2014-04-13 21:35:34 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:41:15 -05:00
break;
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1::F}
2013-12-30 17:41:15 -05:00
case F_SIG: {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[5];
} const tatbl_ = { // transition-action table
&s211_s,
{
Q_ACTION_CAST(&s1_x), // exit
Q_ACTION_CAST(&s2_e), // entry
Q_ACTION_CAST(&s21_e), // entry
Q_ACTION_CAST(&s211_e), // entry
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
BSP_display("s1-F;");
2014-04-13 21:35:34 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:41:15 -05:00
break;
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1::C}
2013-12-30 17:41:15 -05:00
case C_SIG: {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[4];
} const tatbl_ = { // transition-action table
&s2_s,
{
Q_ACTION_CAST(&s1_x), // exit
Q_ACTION_CAST(&s2_e), // entry
Q_ACTION_CAST(&s2_i), // initial tran.
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
BSP_display("s1-C;");
2014-04-13 21:35:34 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:41:15 -05:00
break;
}
default: {
status_ = QM_SUPER();
break;
}
}
return status_;
}
2014-04-13 21:35:34 -04:00
//${SMs::QMsmTst::SM::s::s1::s11} ............................................
2013-12-30 17:41:15 -05:00
QP::QMState const QMsmTst::s11_s = {
2014-04-13 21:35:34 -04:00
&QMsmTst::s1_s, // superstate
Q_STATE_CAST(&s11),
Q_ACTION_CAST(&s11_e),
Q_ACTION_CAST(&s11_x),
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // no intitial tran.
2013-12-30 17:41:15 -05:00
};
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1::s11}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s11_e(QMsmTst * const me) {
BSP_display("s11-ENTRY;");
2014-04-13 21:35:34 -04:00
(void)me; // avoid compiler warning in case 'me' is not used
2013-12-30 17:41:15 -05:00
return QM_ENTRY(&s11_s);
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1::s11}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s11_x(QMsmTst * const me) {
BSP_display("s11-EXIT;");
2014-04-13 21:35:34 -04:00
(void)me; // avoid compiler warning in case 'me' is not used
2013-12-30 17:41:15 -05:00
return QM_EXIT(&s11_s);
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1::s11}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s11(QMsmTst * const me, QP::QEvt const * const e) {
QP::QState status_;
switch (e->sig) {
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1::s11::H}
2013-12-30 17:41:15 -05:00
case H_SIG: {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[4];
} const tatbl_ = { // transition-action table
&s_s,
{
Q_ACTION_CAST(&s11_x), // exit
Q_ACTION_CAST(&s1_x), // exit
Q_ACTION_CAST(&s_i), // initial tran.
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
BSP_display("s11-H;");
2014-04-13 21:35:34 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:41:15 -05:00
break;
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1::s11::D}
2013-12-30 17:41:15 -05:00
case D_SIG: {
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1::s11::D::[me->m_foo]}
2013-12-30 17:41:15 -05:00
if (me->m_foo) {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[3];
} const tatbl_ = { // transition-action table
&s1_s,
{
Q_ACTION_CAST(&s11_x), // exit
Q_ACTION_CAST(&s1_i), // initial tran.
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
me->m_foo = false;
BSP_display("s11-D;");
2014-04-13 21:35:34 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:41:15 -05:00
}
else {
status_ = QM_UNHANDLED();
}
break;
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s1::s11::G}
2013-12-30 17:41:15 -05:00
case G_SIG: {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[6];
} const tatbl_ = { // transition-action table
&s211_s,
{
Q_ACTION_CAST(&s11_x), // exit
Q_ACTION_CAST(&s1_x), // exit
Q_ACTION_CAST(&s2_e), // entry
Q_ACTION_CAST(&s21_e), // entry
Q_ACTION_CAST(&s211_e), // entry
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
BSP_display("s11-G;");
2014-04-13 21:35:34 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:41:15 -05:00
break;
}
default: {
status_ = QM_SUPER();
break;
}
}
return status_;
}
2014-04-13 21:35:34 -04:00
//${SMs::QMsmTst::SM::s::s2} .................................................
2013-12-30 17:41:15 -05:00
QP::QMState const QMsmTst::s2_s = {
2014-04-13 21:35:34 -04:00
&QMsmTst::s_s, // superstate
Q_STATE_CAST(&s2),
Q_ACTION_CAST(&s2_e),
Q_ACTION_CAST(&s2_x),
Q_ACTION_CAST(&s2_i)
2013-12-30 17:41:15 -05:00
};
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s2_e(QMsmTst * const me) {
BSP_display("s2-ENTRY;");
2014-04-13 21:35:34 -04:00
(void)me; // avoid compiler warning in case 'me' is not used
2013-12-30 17:41:15 -05:00
return QM_ENTRY(&s2_s);
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s2_x(QMsmTst * const me) {
BSP_display("s2-EXIT;");
2014-04-13 21:35:34 -04:00
(void)me; // avoid compiler warning in case 'me' is not used
2013-12-30 17:41:15 -05:00
return QM_EXIT(&s2_s);
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::initial}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s2_i(QMsmTst * const me) {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[3];
} const tatbl_ = { // transition-action table
&s211_s,
{
Q_ACTION_CAST(&s21_e), // entry
Q_ACTION_CAST(&s211_e), // entry
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::initial}
2013-12-30 17:41:15 -05:00
BSP_display("s2-INIT;");
2014-04-13 21:35:34 -04:00
return QM_TRAN_INIT(&tatbl_);
2013-12-30 17:41:15 -05:00
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s2(QMsmTst * const me, QP::QEvt const * const e) {
QP::QState status_;
switch (e->sig) {
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::I}
2013-12-30 17:41:15 -05:00
case I_SIG: {
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::I::[!me->m_foo]}
2013-12-30 17:41:15 -05:00
if (!me->m_foo) {
me->m_foo = true;
BSP_display("s2-I;");
status_ = QM_HANDLED();
}
else {
status_ = QM_UNHANDLED();
}
break;
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::F}
2013-12-30 17:41:15 -05:00
case F_SIG: {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[4];
} const tatbl_ = { // transition-action table
&s11_s,
{
Q_ACTION_CAST(&s2_x), // exit
Q_ACTION_CAST(&s1_e), // entry
Q_ACTION_CAST(&s11_e), // entry
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
BSP_display("s2-F;");
2014-04-13 21:35:34 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:41:15 -05:00
break;
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::C}
2013-12-30 17:41:15 -05:00
case C_SIG: {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[4];
} const tatbl_ = { // transition-action table
&s1_s,
{
Q_ACTION_CAST(&s2_x), // exit
Q_ACTION_CAST(&s1_e), // entry
Q_ACTION_CAST(&s1_i), // initial tran.
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
BSP_display("s2-C;");
2014-04-13 21:35:34 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:41:15 -05:00
break;
}
default: {
status_ = QM_SUPER();
break;
}
}
return status_;
}
2014-04-13 21:35:34 -04:00
//${SMs::QMsmTst::SM::s::s2::s21} ............................................
2013-12-30 17:41:15 -05:00
QP::QMState const QMsmTst::s21_s = {
2014-04-13 21:35:34 -04:00
&QMsmTst::s2_s, // superstate
Q_STATE_CAST(&s21),
Q_ACTION_CAST(&s21_e),
Q_ACTION_CAST(&s21_x),
Q_ACTION_CAST(&s21_i)
2013-12-30 17:41:15 -05:00
};
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::s21}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s21_e(QMsmTst * const me) {
BSP_display("s21-ENTRY;");
2014-04-13 21:35:34 -04:00
(void)me; // avoid compiler warning in case 'me' is not used
2013-12-30 17:41:15 -05:00
return QM_ENTRY(&s21_s);
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::s21}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s21_x(QMsmTst * const me) {
BSP_display("s21-EXIT;");
2014-04-13 21:35:34 -04:00
(void)me; // avoid compiler warning in case 'me' is not used
2013-12-30 17:41:15 -05:00
return QM_EXIT(&s21_s);
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::s21::initial}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s21_i(QMsmTst * const me) {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[2];
} const tatbl_ = { // transition-action table
&s211_s,
{
Q_ACTION_CAST(&s211_e), // entry
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::s21::initial}
2013-12-30 17:41:15 -05:00
BSP_display("s21-INIT;");
2014-04-13 21:35:34 -04:00
return QM_TRAN_INIT(&tatbl_);
2013-12-30 17:41:15 -05:00
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::s21}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s21(QMsmTst * const me, QP::QEvt const * const e) {
QP::QState status_;
switch (e->sig) {
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::s21::G}
2013-12-30 17:41:15 -05:00
case G_SIG: {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[5];
} const tatbl_ = { // transition-action table
&s1_s,
{
Q_ACTION_CAST(&s21_x), // exit
Q_ACTION_CAST(&s2_x), // exit
Q_ACTION_CAST(&s1_e), // entry
Q_ACTION_CAST(&s1_i), // initial tran.
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
BSP_display("s21-G;");
2014-04-13 21:35:34 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:41:15 -05:00
break;
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::s21::A}
2013-12-30 17:41:15 -05:00
case A_SIG: {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[4];
} const tatbl_ = { // transition-action table
&s21_s,
{
Q_ACTION_CAST(&s21_x), // exit
Q_ACTION_CAST(&s21_e), // entry
Q_ACTION_CAST(&s21_i), // initial tran.
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
BSP_display("s21-A;");
2014-04-13 21:35:34 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:41:15 -05:00
break;
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::s21::B}
2013-12-30 17:41:15 -05:00
case B_SIG: {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[2];
} const tatbl_ = { // transition-action table
&s211_s,
{
Q_ACTION_CAST(&s211_e), // entry
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
BSP_display("s21-B;");
2014-04-13 21:35:34 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:41:15 -05:00
break;
}
default: {
status_ = QM_SUPER();
break;
}
}
return status_;
}
2014-04-13 21:35:34 -04:00
//${SMs::QMsmTst::SM::s::s2::s21::s211} ......................................
2013-12-30 17:41:15 -05:00
QP::QMState const QMsmTst::s211_s = {
2014-04-13 21:35:34 -04:00
&QMsmTst::s21_s, // superstate
Q_STATE_CAST(&s211),
Q_ACTION_CAST(&s211_e),
Q_ACTION_CAST(&s211_x),
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // no intitial tran.
2013-12-30 17:41:15 -05:00
};
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::s21::s211}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s211_e(QMsmTst * const me) {
BSP_display("s211-ENTRY;");
2014-04-13 21:35:34 -04:00
(void)me; // avoid compiler warning in case 'me' is not used
2013-12-30 17:41:15 -05:00
return QM_ENTRY(&s211_s);
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::s21::s211}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s211_x(QMsmTst * const me) {
BSP_display("s211-EXIT;");
2014-04-13 21:35:34 -04:00
(void)me; // avoid compiler warning in case 'me' is not used
2013-12-30 17:41:15 -05:00
return QM_EXIT(&s211_s);
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::s21::s211}
2013-12-30 17:41:15 -05:00
QP::QState QMsmTst::s211(QMsmTst * const me, QP::QEvt const * const e) {
QP::QState status_;
switch (e->sig) {
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::s21::s211::H}
2013-12-30 17:41:15 -05:00
case H_SIG: {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[5];
} const tatbl_ = { // transition-action table
&s_s,
{
Q_ACTION_CAST(&s211_x), // exit
Q_ACTION_CAST(&s21_x), // exit
Q_ACTION_CAST(&s2_x), // exit
Q_ACTION_CAST(&s_i), // initial tran.
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
BSP_display("s211-H;");
2014-04-13 21:35:34 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:41:15 -05:00
break;
}
2014-04-13 21:35:34 -04:00
// ${SMs::QMsmTst::SM::s::s2::s21::s211::D}
2013-12-30 17:41:15 -05:00
case D_SIG: {
2014-04-13 21:35:34 -04:00
static struct {
QP::QMState const *target;
QP::QActionHandler act[3];
} const tatbl_ = { // transition-action table
&s21_s,
{
Q_ACTION_CAST(&s211_x), // exit
Q_ACTION_CAST(&s21_i), // initial tran.
2014-04-13 21:35:34 -04:00
Q_ACTION_CAST(0) // zero terminator
}
2013-12-30 17:41:15 -05:00
};
BSP_display("s211-D;");
2014-04-13 21:35:34 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:41:15 -05:00
break;
}
default: {
status_ = QM_SUPER();
break;
}
}
return status_;
}
} // namespace QMSMTST