fpp/compiler/tools/fpp-to-cpp/test/state-machine/initial/NestedStateMachineAc.ref.hpp
2024-09-22 19:52:17 -07:00

108 lines
2.8 KiB
C++

// ======================================================================
// \title NestedStateMachineAc.hpp
// \author Generated by fpp-to-cpp
// \brief hpp file for Nested state machine
// ======================================================================
#ifndef FppTest_NestedStateMachineAc_HPP
#define FppTest_NestedStateMachineAc_HPP
#include <FpConfig.hpp>
#include "Fw/Types/ExternalString.hpp"
#include "Fw/Types/Serializable.hpp"
#include "Fw/Types/String.hpp"
namespace FppTest {
//! A state machine with nested initial transitions
class NestedStateMachineBase {
PROTECTED:
// ----------------------------------------------------------------------
// Types
// ----------------------------------------------------------------------
//! The state type
enum class State : FwEnumStoreType {
//! The uninitialized state
__FPRIME_AC_UNINITIALIZED,
//! State S.T
S_T,
};
//! The signal type
enum class Signal : FwEnumStoreType {
//! The initial transition
__FPRIME_AC_INITIAL_TRANSITION,
};
PROTECTED:
// ----------------------------------------------------------------------
// Constructors and Destructors
// ----------------------------------------------------------------------
//! Constructor
NestedStateMachineBase();
//! Destructor
virtual ~NestedStateMachineBase();
public:
// ----------------------------------------------------------------------
// Initialization
// ----------------------------------------------------------------------
//! Initialize the state machine
void init(
const FwEnumStoreType id //!< The state machine ID
);
PROTECTED:
// ----------------------------------------------------------------------
// Actions
// ----------------------------------------------------------------------
//! Action a
virtual void action_a(
Signal signal //!< The signal
) = 0;
PRIVATE:
// ----------------------------------------------------------------------
// State and junction entry
// ----------------------------------------------------------------------
//! Enter state S
void enter_S(
Signal signal //!< The signal
);
//! Enter state S_T
void enter_S_T(
Signal signal //!< The signal
);
PROTECTED:
// ----------------------------------------------------------------------
// Member variables
// ----------------------------------------------------------------------
//! The state machine ID
FwEnumStoreType m_id = 0;
//! The state
State m_state = State::__FPRIME_AC_UNINITIALIZED;
};
}
#endif