FinalState.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef FINALSTATE_H_
  2. #define FINALSTATE_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'FinalState'.
  6. */
  7. class FinalState : public StatemachineInterface
  8. {
  9. public:
  10. FinalState();
  11. ~FinalState();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. main_region_myState,
  16. main_region__final_,
  17. FinalState_last_state
  18. } FinalStateStates;
  19. /*
  20. * Functions inherited from StatemachineInterface
  21. */
  22. virtual void init();
  23. virtual void enter();
  24. virtual void exit();
  25. virtual void runCycle();
  26. /*!
  27. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  28. * 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.
  29. */
  30. virtual sc_boolean isActive() const;
  31. /*!
  32. * Checks if all active states are final.
  33. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  34. */
  35. virtual sc_boolean isFinal() const;
  36. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  37. sc_boolean isStateActive(FinalStateStates state) const;
  38. private:
  39. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  40. static const sc_integer maxOrthogonalStates = 1;
  41. FinalStateStates stateConfVector[maxOrthogonalStates];
  42. sc_ushort stateConfVectorPosition;
  43. // prototypes of all internal functions
  44. sc_boolean check_main_region_myState_tr0_tr0();
  45. void effect_main_region_myState_tr0();
  46. void enseq_main_region_myState_default();
  47. void enseq_main_region__final__default();
  48. void enseq_main_region_default();
  49. void exseq_main_region_myState();
  50. void exseq_main_region__final_();
  51. void exseq_main_region();
  52. void react_main_region_myState();
  53. void react_main_region__final_();
  54. void react_main_region__entry_Default();
  55. void clearInEvents();
  56. void clearOutEvents();
  57. };
  58. #endif /* FINALSTATE_H_ */