StatemachineInterface.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef STATEMACHINEINTERFACE_H_
  2. #define STATEMACHINEINTERFACE_H_
  3. /*! \file Basic interface for state machines.
  4. */
  5. class StatemachineInterface
  6. {
  7. public:
  8. virtual ~StatemachineInterface() = 0;
  9. /*! Initializes the state machine. Used to initialize internal variables etc.
  10. */
  11. virtual void init() = 0;
  12. /*! Enters the state machine. Sets the state machine into a defined state.
  13. */
  14. virtual void enter() = 0;
  15. /*! Exits the state machine. Leaves the state machine with a defined state.
  16. */
  17. virtual void exit() = 0;
  18. /*! Start a run-to-completion cycle.
  19. */
  20. virtual void runCycle() = 0;
  21. /*! Checks whether the state machine is active.
  22. A state machine is active if it has been entered. It is inactive if it has not been entered at all or if it has been exited.
  23. */
  24. virtual sc_boolean isActive() const = 0;
  25. /*! Checks if all active states are final.
  26. If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  27. */
  28. virtual sc_boolean isFinal() const = 0;
  29. };
  30. inline StatemachineInterface::~StatemachineInterface() {}
  31. #endif /* STATEMACHINEINTERFACE_H_ */