Choice.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. #ifndef CHOICE_H_
  2. #define CHOICE_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'Choice'.
  6. */
  7. class Choice : public StatemachineInterface
  8. {
  9. public:
  10. Choice();
  11. ~Choice();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. main_region_A,
  16. main_region_B,
  17. main_region_C,
  18. Choice_last_state
  19. } ChoiceStates;
  20. //! Inner class for default interface scope.
  21. class DefaultSCI
  22. {
  23. public:
  24. /*! Raises the in event 'e' that is defined in the default interface scope. */
  25. void raise_e();
  26. /*! Raises the in event 'f' that is defined in the default interface scope. */
  27. void raise_f();
  28. /*! Raises the in event 'g' that is defined in the default interface scope. */
  29. void raise_g();
  30. /*! Raises the in event 'h' that is defined in the default interface scope. */
  31. void raise_h();
  32. /*! Gets the value of the variable 'c' that is defined in the default interface scope. */
  33. sc_boolean get_c() const;
  34. /*! Sets the value of the variable 'c' that is defined in the default interface scope. */
  35. void set_c(sc_boolean value);
  36. private:
  37. friend class Choice;
  38. sc_boolean e_raised;
  39. sc_boolean f_raised;
  40. sc_boolean g_raised;
  41. sc_boolean h_raised;
  42. sc_boolean c;
  43. };
  44. /*! Returns an instance of the interface class 'DefaultSCI'. */
  45. DefaultSCI* getDefaultSCI();
  46. /*! Raises the in event 'e' that is defined in the default interface scope. */
  47. void raise_e();
  48. /*! Raises the in event 'f' that is defined in the default interface scope. */
  49. void raise_f();
  50. /*! Raises the in event 'g' that is defined in the default interface scope. */
  51. void raise_g();
  52. /*! Raises the in event 'h' that is defined in the default interface scope. */
  53. void raise_h();
  54. /*! Gets the value of the variable 'c' that is defined in the default interface scope. */
  55. sc_boolean get_c() const;
  56. /*! Sets the value of the variable 'c' that is defined in the default interface scope. */
  57. void set_c(sc_boolean value);
  58. /*
  59. * Functions inherited from StatemachineInterface
  60. */
  61. virtual void init();
  62. virtual void enter();
  63. virtual void exit();
  64. virtual void runCycle();
  65. /*!
  66. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  67. * 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.
  68. */
  69. virtual sc_boolean isActive() const;
  70. /*!
  71. * Checks if all active states are final.
  72. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  73. */
  74. virtual sc_boolean isFinal() const;
  75. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  76. sc_boolean isStateActive(ChoiceStates state) const;
  77. private:
  78. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  79. static const sc_integer maxOrthogonalStates = 1;
  80. ChoiceStates stateConfVector[maxOrthogonalStates];
  81. sc_ushort stateConfVectorPosition;
  82. DefaultSCI iface;
  83. // prototypes of all internal functions
  84. sc_boolean check_main_region_A_tr0_tr0();
  85. sc_boolean check_main_region_A_tr1_tr1();
  86. sc_boolean check_main_region_A_tr2_tr2();
  87. sc_boolean check_main_region_A_tr3_tr3();
  88. sc_boolean check_main_region_B_tr0_tr0();
  89. sc_boolean check_main_region_C_tr0_tr0();
  90. sc_boolean check_main_region__choice_0_tr1_tr1();
  91. sc_boolean check_main_region__choice_0_tr0_tr0();
  92. sc_boolean check_main_region__choice_1_tr0_tr0();
  93. sc_boolean check_main_region__choice_1_tr1_tr1();
  94. sc_boolean check_main_region__choice_2_tr1_tr1();
  95. sc_boolean check_main_region__choice_2_tr0();
  96. sc_boolean check_main_region__choice_3_tr1_tr1();
  97. sc_boolean check_main_region__choice_3_tr0_tr0();
  98. void effect_main_region_A_tr0();
  99. void effect_main_region_A_tr1();
  100. void effect_main_region_A_tr2();
  101. void effect_main_region_A_tr3();
  102. void effect_main_region_B_tr0();
  103. void effect_main_region_C_tr0();
  104. void effect_main_region__choice_0_tr1();
  105. void effect_main_region__choice_0_tr0();
  106. void effect_main_region__choice_1_tr0();
  107. void effect_main_region__choice_1_tr1();
  108. void effect_main_region__choice_2_tr1();
  109. void effect_main_region__choice_2_tr0();
  110. void effect_main_region__choice_3_tr1();
  111. void effect_main_region__choice_3_tr0();
  112. void enseq_main_region_A_default();
  113. void enseq_main_region_B_default();
  114. void enseq_main_region_C_default();
  115. void enseq_main_region_default();
  116. void exseq_main_region_A();
  117. void exseq_main_region_B();
  118. void exseq_main_region_C();
  119. void exseq_main_region();
  120. void react_main_region_A();
  121. void react_main_region_B();
  122. void react_main_region_C();
  123. void react_main_region__choice_0();
  124. void react_main_region__choice_1();
  125. void react_main_region__choice_2();
  126. void react_main_region__choice_3();
  127. void react_main_region__entry_Default();
  128. void clearInEvents();
  129. void clearOutEvents();
  130. };
  131. #endif /* CHOICE_H_ */