TimedTransitions.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. #ifndef TIMEDTRANSITIONS_H_
  2. #define TIMEDTRANSITIONS_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. #include "TimedStatemachineInterface.h"
  6. /*! \file Header of the state machine 'TimedTransitions'.
  7. */
  8. class TimedTransitions : public TimedStatemachineInterface, public StatemachineInterface
  9. {
  10. public:
  11. TimedTransitions();
  12. ~TimedTransitions();
  13. /*! Enumeration of all states */
  14. typedef enum
  15. {
  16. main_region_Start,
  17. main_region_End,
  18. TimedTransitions_last_state
  19. } TimedTransitionsStates;
  20. /*
  21. * Functions inherited from StatemachineInterface
  22. */
  23. virtual void init();
  24. virtual void enter();
  25. virtual void exit();
  26. virtual void runCycle();
  27. /*!
  28. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  29. * 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.
  30. */
  31. virtual sc_boolean isActive() const;
  32. /*!
  33. * Checks if all active states are final.
  34. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  35. */
  36. virtual sc_boolean isFinal() const;
  37. /*
  38. * Functions inherited from TimedStatemachineInterface
  39. */
  40. virtual void setTimer(TimerInterface* timer);
  41. virtual TimerInterface* getTimer();
  42. virtual void raiseTimeEvent(sc_eventid event);
  43. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  44. sc_boolean isStateActive(TimedTransitionsStates state) const;
  45. private:
  46. //! Inner class for internal interface scope.
  47. class InternalSCI
  48. {
  49. public:
  50. /*! Gets the value of the variable 'x' that is defined in the internal scope. */
  51. sc_integer get_x() const;
  52. /*! Sets the value of the variable 'x' that is defined in the internal scope. */
  53. void set_x(sc_integer value);
  54. /*! Gets the value of the variable 'y' that is defined in the internal scope. */
  55. sc_integer get_y() const;
  56. /*! Sets the value of the variable 'y' that is defined in the internal scope. */
  57. void set_y(sc_integer value);
  58. private:
  59. friend class TimedTransitions;
  60. sc_integer x;
  61. sc_integer y;
  62. };
  63. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  64. static const sc_integer maxOrthogonalStates = 1;
  65. //! number of time events used by the state machine.
  66. static const sc_integer timeEventsCount = 2;
  67. TimerInterface* timer;
  68. sc_boolean timeEvents[timeEventsCount];
  69. TimedTransitionsStates stateConfVector[maxOrthogonalStates];
  70. sc_ushort stateConfVectorPosition;
  71. InternalSCI ifaceInternalSCI;
  72. // prototypes of all internal functions
  73. sc_boolean check__lr0();
  74. sc_boolean check__lr1();
  75. sc_boolean check_main_region_Start_tr0_tr0();
  76. void effect__lr0();
  77. void effect__lr1();
  78. void effect_main_region_Start_tr0();
  79. void enact();
  80. void enact_main_region_Start();
  81. void exact();
  82. void exact_main_region_Start();
  83. void enseq_main_region_Start_default();
  84. void enseq_main_region_End_default();
  85. void enseq_main_region_default();
  86. void exseq_main_region_Start();
  87. void exseq_main_region_End();
  88. void exseq_main_region();
  89. void react_main_region_Start();
  90. void react_main_region_End();
  91. void react_main_region__entry_Default();
  92. void clearInEvents();
  93. void clearOutEvents();
  94. };
  95. #endif /* TIMEDTRANSITIONS_H_ */