HistoryWithExitPoint.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. #ifndef HISTORYWITHEXITPOINT_H_
  2. #define HISTORYWITHEXITPOINT_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'HistoryWithExitPoint'.
  6. */
  7. class HistoryWithExitPoint : public StatemachineInterface
  8. {
  9. public:
  10. HistoryWithExitPoint();
  11. ~HistoryWithExitPoint();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. mr_A,
  16. mr_A_r_X1,
  17. mr_A_r_X2,
  18. mr_B,
  19. HistoryWithExitPoint_last_state
  20. } HistoryWithExitPointStates;
  21. //! Inner class for default interface scope.
  22. class DefaultSCI
  23. {
  24. public:
  25. /*! Raises the in event 'push' that is defined in the default interface scope. */
  26. void raise_push();
  27. /*! Raises the in event 'back' that is defined in the default interface scope. */
  28. void raise_back();
  29. /*! Raises the in event 'next' that is defined in the default interface scope. */
  30. void raise_next();
  31. private:
  32. friend class HistoryWithExitPoint;
  33. sc_boolean push_raised;
  34. sc_boolean back_raised;
  35. sc_boolean next_raised;
  36. };
  37. /*! Returns an instance of the interface class 'DefaultSCI'. */
  38. DefaultSCI* getDefaultSCI();
  39. /*! Raises the in event 'push' that is defined in the default interface scope. */
  40. void raise_push();
  41. /*! Raises the in event 'back' that is defined in the default interface scope. */
  42. void raise_back();
  43. /*! Raises the in event 'next' that is defined in the default interface scope. */
  44. void raise_next();
  45. /*
  46. * Functions inherited from StatemachineInterface
  47. */
  48. virtual void init();
  49. virtual void enter();
  50. virtual void exit();
  51. virtual void runCycle();
  52. /*!
  53. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  54. * 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.
  55. */
  56. virtual sc_boolean isActive() const;
  57. /*!
  58. * Checks if all active states are final.
  59. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  60. */
  61. virtual sc_boolean isFinal() const;
  62. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  63. sc_boolean isStateActive(HistoryWithExitPointStates state) const;
  64. private:
  65. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  66. static const sc_integer maxOrthogonalStates = 1;
  67. //! dimension of the state configuration vector for history states
  68. static const sc_integer maxHistoryStates = 1;
  69. HistoryWithExitPointStates stateConfVector[maxOrthogonalStates];
  70. HistoryWithExitPointStates historyVector[maxHistoryStates];
  71. sc_ushort stateConfVectorPosition;
  72. DefaultSCI iface;
  73. // prototypes of all internal functions
  74. sc_boolean check_mr_A_r_X1_tr0_tr0();
  75. sc_boolean check_mr_A_r_X1_tr1_tr1();
  76. sc_boolean check_mr_A_r_X2_tr0_tr0();
  77. sc_boolean check_mr_A_r_X2_tr1_tr1();
  78. sc_boolean check_mr_B_tr0_tr0();
  79. void effect_mr_A_tr0();
  80. void effect_mr_A_r_X1_tr0();
  81. void effect_mr_A_r_X1_tr1();
  82. void effect_mr_A_r_X2_tr0();
  83. void effect_mr_A_r_X2_tr1();
  84. void effect_mr_B_tr0();
  85. void enseq_mr_A_default();
  86. void enseq_mr_A_r_X1_default();
  87. void enseq_mr_A_r_X2_default();
  88. void enseq_mr_B_default();
  89. void enseq_mr_default();
  90. void enseq_mr_A_r_default();
  91. void shenseq_mr_A_r();
  92. void exseq_mr_A();
  93. void exseq_mr_A_r_X1();
  94. void exseq_mr_A_r_X2();
  95. void exseq_mr_B();
  96. void exseq_mr();
  97. void exseq_mr_A_r();
  98. void react_mr_A_r_X1();
  99. void react_mr_A_r_X2();
  100. void react_mr_B();
  101. void react_mr__entry_Default();
  102. void react_mr_A_r__entry_Default();
  103. void react_mr_A_r_exit_to_B();
  104. void clearInEvents();
  105. void clearOutEvents();
  106. };
  107. #endif /* HISTORYWITHEXITPOINT_H_ */