mirror of
https://github.com/nasa/fpp.git
synced 2025-12-11 11:16:42 -06:00
156 lines
4.5 KiB
C++
Vendored
156 lines
4.5 KiB
C++
Vendored
// ======================================================================
|
|
// \title BasicGuardTestEnumStateMachineAc.hpp
|
|
// \author Generated by fpp-to-cpp
|
|
// \brief hpp file for BasicGuardTestEnum state machine
|
|
// ======================================================================
|
|
|
|
#ifndef FppTest_SmState_BasicGuardTestEnumStateMachineAc_HPP
|
|
#define FppTest_SmState_BasicGuardTestEnumStateMachineAc_HPP
|
|
|
|
#include "Fw/FPrimeBasicTypes.hpp"
|
|
#include "Fw/Types/ExternalString.hpp"
|
|
#include "Fw/Types/Serializable.hpp"
|
|
#include "Fw/Types/String.hpp"
|
|
#include "state-machine/harness/TestEnumEnumAc.hpp"
|
|
|
|
namespace FppTest {
|
|
|
|
namespace SmState {
|
|
|
|
//! A basic state machine with a TestEnum guard
|
|
class BasicGuardTestEnumStateMachineBase {
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Friend classes
|
|
// ----------------------------------------------------------------------
|
|
|
|
//! Tester class for the state machine
|
|
friend class BasicGuardTestEnumTester;
|
|
|
|
public:
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Types
|
|
// ----------------------------------------------------------------------
|
|
|
|
//! The state type
|
|
enum class State : FwEnumStoreType {
|
|
//! The uninitialized state
|
|
__FPRIME_AC_UNINITIALIZED,
|
|
//! State S
|
|
S,
|
|
//! State T
|
|
T,
|
|
};
|
|
|
|
//! The signal type
|
|
enum class Signal : FwEnumStoreType {
|
|
//! The initial transition
|
|
__FPRIME_AC_INITIAL_TRANSITION,
|
|
//! Signal s
|
|
s,
|
|
};
|
|
|
|
protected:
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Constructors and Destructors
|
|
// ----------------------------------------------------------------------
|
|
|
|
//! Constructor
|
|
BasicGuardTestEnumStateMachineBase();
|
|
|
|
//! Destructor
|
|
virtual ~BasicGuardTestEnumStateMachineBase();
|
|
|
|
protected:
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Initialization
|
|
// ----------------------------------------------------------------------
|
|
|
|
//! Initialize the state machine
|
|
void initBase(
|
|
const FwEnumStoreType id //!< The state machine ID
|
|
);
|
|
|
|
public:
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Getter functions
|
|
// ----------------------------------------------------------------------
|
|
|
|
//! Get the state
|
|
BasicGuardTestEnumStateMachineBase::State getState() const;
|
|
|
|
public:
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Send signal functions
|
|
// ----------------------------------------------------------------------
|
|
|
|
//! Signal s
|
|
void sendSignal_s(
|
|
const FppTest::SmHarness::TestEnum& value //!< The value
|
|
);
|
|
|
|
protected:
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Actions
|
|
// ----------------------------------------------------------------------
|
|
|
|
//! Action a
|
|
virtual void action_a(
|
|
Signal signal, //!< The signal
|
|
const FppTest::SmHarness::TestEnum& value //!< The value
|
|
) = 0;
|
|
|
|
protected:
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Guards
|
|
// ----------------------------------------------------------------------
|
|
|
|
//! Guard g
|
|
virtual bool guard_g(
|
|
Signal signal, //!< The signal
|
|
const FppTest::SmHarness::TestEnum& value //!< The value
|
|
) const = 0;
|
|
|
|
private:
|
|
|
|
// ----------------------------------------------------------------------
|
|
// State and choice entry
|
|
// ----------------------------------------------------------------------
|
|
|
|
//! Enter state T
|
|
void enter_T(
|
|
Signal signal //!< The signal
|
|
);
|
|
|
|
//! Enter state S
|
|
void enter_S(
|
|
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
|