StatechartLocalReactions.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #ifndef STATECHARTLOCALREACTIONS_H_
  2. #define STATECHARTLOCALREACTIONS_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'StatechartLocalReactions'.
  6. */
  7. class StatechartLocalReactions : public StatemachineInterface
  8. {
  9. public:
  10. StatechartLocalReactions();
  11. ~StatechartLocalReactions();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. main_region_S1,
  16. main_region_S2,
  17. region2_a,
  18. StatechartLocalReactions_last_state
  19. } StatechartLocalReactionsStates;
  20. //! Inner class for default interface scope.
  21. class DefaultSCI
  22. {
  23. public:
  24. /*! Gets the value of the variable 'myInt' that is defined in the default interface scope. */
  25. sc_integer get_myInt() const;
  26. /*! Sets the value of the variable 'myInt' that is defined in the default interface scope. */
  27. void set_myInt(sc_integer value);
  28. private:
  29. friend class StatechartLocalReactions;
  30. sc_integer myInt;
  31. };
  32. /*! Returns an instance of the interface class 'DefaultSCI'. */
  33. DefaultSCI* getDefaultSCI();
  34. /*! Gets the value of the variable 'myInt' that is defined in the default interface scope. */
  35. sc_integer get_myInt() const;
  36. /*! Sets the value of the variable 'myInt' that is defined in the default interface scope. */
  37. void set_myInt(sc_integer value);
  38. /*
  39. * Functions inherited from StatemachineInterface
  40. */
  41. virtual void init();
  42. virtual void enter();
  43. virtual void exit();
  44. virtual void runCycle();
  45. /*!
  46. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  47. * 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.
  48. */
  49. virtual sc_boolean isActive() const;
  50. /*!
  51. * Checks if all active states are final.
  52. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  53. */
  54. virtual sc_boolean isFinal() const;
  55. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  56. sc_boolean isStateActive(StatechartLocalReactionsStates state) const;
  57. private:
  58. //! Inner class for internal interface scope.
  59. class InternalSCI
  60. {
  61. public:
  62. private:
  63. friend class StatechartLocalReactions;
  64. };
  65. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  66. static const sc_integer maxOrthogonalStates = 2;
  67. StatechartLocalReactionsStates stateConfVector[maxOrthogonalStates];
  68. sc_ushort stateConfVectorPosition;
  69. DefaultSCI iface;
  70. InternalSCI ifaceInternalSCI;
  71. // prototypes of all internal functions
  72. sc_boolean check__lr0();
  73. sc_boolean check__lr1();
  74. sc_boolean check_main_region_S1_tr0_tr0();
  75. sc_boolean check_main_region_S2_tr0_tr0();
  76. void effect__lr0();
  77. void effect__lr1();
  78. void effect_main_region_S1_tr0();
  79. void effect_main_region_S2_tr0();
  80. void enseq_main_region_S1_default();
  81. void enseq_main_region_S2_default();
  82. void enseq_region2_a_default();
  83. void enseq_main_region_default();
  84. void enseq_region2_default();
  85. void exseq_main_region_S1();
  86. void exseq_main_region_S2();
  87. void exseq_region2_a();
  88. void exseq_main_region();
  89. void exseq_region2();
  90. void react_main_region_S1();
  91. void react_main_region_S2();
  92. void react_region2_a();
  93. void react_main_region__entry_Default();
  94. void react_region2__entry_Default();
  95. void clearInEvents();
  96. void clearOutEvents();
  97. };
  98. #endif /* STATECHARTLOCALREACTIONS_H_ */