fpp/compiler/tools/fpp-to-cpp/test/state-machine/initial/NestedStateMachineAc.ref.cpp
Rob Bocchino ab44e7ffc4 Revise state machine code gen
Add comments
2024-11-20 14:43:21 -08:00

81 lines
2.2 KiB
C++

// ======================================================================
// \title NestedStateMachineAc.cpp
// \author Generated by fpp-to-cpp
// \brief cpp file for Nested state machine
// ======================================================================
#include "Fw/Types/Assert.hpp"
#include "NestedStateMachineAc.hpp"
namespace FppTest {
namespace SmInitial {
// ----------------------------------------------------------------------
// Constructors and Destructors
// ----------------------------------------------------------------------
NestedStateMachineBase ::
NestedStateMachineBase()
{
}
NestedStateMachineBase ::
~NestedStateMachineBase()
{
}
// ----------------------------------------------------------------------
// Initialization
// ----------------------------------------------------------------------
void NestedStateMachineBase ::
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Do the actions for the state machine initial transition
this->action_a(Signal::__FPRIME_AC_INITIAL_TRANSITION);
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
// ----------------------------------------------------------------------
// Getter functions
// ----------------------------------------------------------------------
NestedStateMachineBase::State NestedStateMachineBase ::
getState() const
{
return this->m_state;
}
// ----------------------------------------------------------------------
// State and choice entry
// ----------------------------------------------------------------------
void NestedStateMachineBase ::
enter_S(Signal signal)
{
// Do the entry actions
this->action_a(signal);
this->action_a(signal);
// Enter the target of the initial transition
this->enter_S_T(signal);
}
void NestedStateMachineBase ::
enter_S_T(Signal signal)
{
// Do the entry actions
this->action_a(signal);
this->action_a(signal);
this->action_a(signal);
this->m_state = State::S_T;
}
}
}