EntryExitSelfTransition.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. #ifndef ENTRYEXITSELFTRANSITION_H_
  2. #define ENTRYEXITSELFTRANSITION_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'EntryExitSelfTransition'.
  6. */
  7. class EntryExitSelfTransition : public StatemachineInterface
  8. {
  9. public:
  10. EntryExitSelfTransition();
  11. ~EntryExitSelfTransition();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. main_region_A,
  16. main_region_A__region0_B,
  17. main_region_A__region0_C,
  18. EntryExitSelfTransition_last_state
  19. } EntryExitSelfTransitionStates;
  20. //! Inner class for default interface scope.
  21. class DefaultSCI
  22. {
  23. public:
  24. /*! Gets the value of the variable 'exits' that is defined in the default interface scope. */
  25. sc_integer get_exits() const;
  26. /*! Sets the value of the variable 'exits' that is defined in the default interface scope. */
  27. void set_exits(sc_integer value);
  28. /*! Gets the value of the variable 'entries' that is defined in the default interface scope. */
  29. sc_integer get_entries() const;
  30. /*! Sets the value of the variable 'entries' that is defined in the default interface scope. */
  31. void set_entries(sc_integer value);
  32. /*! Raises the in event 'e' that is defined in the default interface scope. */
  33. void raise_e();
  34. /*! Raises the in event 'e1' that is defined in the default interface scope. */
  35. void raise_e1();
  36. private:
  37. friend class EntryExitSelfTransition;
  38. sc_integer exits;
  39. sc_integer entries;
  40. sc_boolean e_raised;
  41. sc_boolean e1_raised;
  42. };
  43. /*! Returns an instance of the interface class 'DefaultSCI'. */
  44. DefaultSCI* getDefaultSCI();
  45. /*! Gets the value of the variable 'exits' that is defined in the default interface scope. */
  46. sc_integer get_exits() const;
  47. /*! Sets the value of the variable 'exits' that is defined in the default interface scope. */
  48. void set_exits(sc_integer value);
  49. /*! Gets the value of the variable 'entries' that is defined in the default interface scope. */
  50. sc_integer get_entries() const;
  51. /*! Sets the value of the variable 'entries' that is defined in the default interface scope. */
  52. void set_entries(sc_integer value);
  53. /*! Raises the in event 'e' that is defined in the default interface scope. */
  54. void raise_e();
  55. /*! Raises the in event 'e1' that is defined in the default interface scope. */
  56. void raise_e1();
  57. /*
  58. * Functions inherited from StatemachineInterface
  59. */
  60. virtual void init();
  61. virtual void enter();
  62. virtual void exit();
  63. virtual void runCycle();
  64. /*!
  65. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  66. * 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.
  67. */
  68. virtual sc_boolean isActive() const;
  69. /*!
  70. * Checks if all active states are final.
  71. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  72. */
  73. virtual sc_boolean isFinal() const;
  74. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  75. sc_boolean isStateActive(EntryExitSelfTransitionStates state) const;
  76. private:
  77. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  78. static const sc_integer maxOrthogonalStates = 1;
  79. EntryExitSelfTransitionStates stateConfVector[maxOrthogonalStates];
  80. sc_ushort stateConfVectorPosition;
  81. DefaultSCI iface;
  82. // prototypes of all internal functions
  83. sc_boolean check_main_region_A_tr0_tr0();
  84. sc_boolean check_main_region_A__region0_B_tr0_tr0();
  85. sc_boolean check_main_region_A__region0_C_tr0_tr0();
  86. void effect_main_region_A_tr0();
  87. void effect_main_region_A__region0_B_tr0();
  88. void effect_main_region_A__region0_C_tr0();
  89. void enact_main_region_A();
  90. void exact_main_region_A();
  91. void enseq_main_region_A_default();
  92. void enseq_main_region_A__region0_B_default();
  93. void enseq_main_region_A__region0_C_default();
  94. void enseq_main_region_default();
  95. void enseq_main_region_A__region0_default();
  96. void exseq_main_region_A();
  97. void exseq_main_region_A__region0_B();
  98. void exseq_main_region_A__region0_C();
  99. void exseq_main_region();
  100. void exseq_main_region_A__region0();
  101. void react_main_region_A__region0_B();
  102. void react_main_region_A__region0_C();
  103. void react_main_region__entry_Default();
  104. void react_main_region_A__region0__entry_Default();
  105. void clearInEvents();
  106. void clearOutEvents();
  107. };
  108. #endif /* ENTRYEXITSELFTRANSITION_H_ */