StaticChoice.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. #ifndef STATICCHOICE_H_
  2. #define STATICCHOICE_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'StaticChoice'.
  6. */
  7. class StaticChoice : public StatemachineInterface
  8. {
  9. public:
  10. StaticChoice();
  11. ~StaticChoice();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. main_region_Start,
  16. main_region_B,
  17. main_region_A,
  18. StaticChoice_last_state
  19. } StaticChoiceStates;
  20. //! Inner class for default interface scope.
  21. class DefaultSCI
  22. {
  23. public:
  24. /*! Gets the value of the variable 'number' that is defined in the default interface scope. */
  25. sc_integer get_number() const;
  26. /*! Sets the value of the variable 'number' that is defined in the default interface scope. */
  27. void set_number(sc_integer value);
  28. /*! Raises the in event 'reset' that is defined in the default interface scope. */
  29. void raise_reset();
  30. private:
  31. friend class StaticChoice;
  32. sc_integer number;
  33. sc_boolean reset_raised;
  34. };
  35. /*! Returns an instance of the interface class 'DefaultSCI'. */
  36. DefaultSCI* getDefaultSCI();
  37. /*! Gets the value of the variable 'number' that is defined in the default interface scope. */
  38. sc_integer get_number() const;
  39. /*! Sets the value of the variable 'number' that is defined in the default interface scope. */
  40. void set_number(sc_integer value);
  41. /*! Raises the in event 'reset' that is defined in the default interface scope. */
  42. void raise_reset();
  43. /*
  44. * Functions inherited from StatemachineInterface
  45. */
  46. virtual void init();
  47. virtual void enter();
  48. virtual void exit();
  49. virtual void runCycle();
  50. /*!
  51. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  52. * 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.
  53. */
  54. virtual sc_boolean isActive() const;
  55. /*!
  56. * Checks if all active states are final.
  57. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  58. */
  59. virtual sc_boolean isFinal() const;
  60. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  61. sc_boolean isStateActive(StaticChoiceStates state) const;
  62. private:
  63. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  64. static const sc_integer maxOrthogonalStates = 1;
  65. StaticChoiceStates stateConfVector[maxOrthogonalStates];
  66. sc_ushort stateConfVectorPosition;
  67. DefaultSCI iface;
  68. // prototypes of all internal functions
  69. sc_boolean check_main_region_Start_tr0_tr0();
  70. sc_boolean check_main_region__choice_0_tr1_tr1();
  71. sc_boolean check_main_region__choice_0_tr0();
  72. void effect_main_region_Start_tr0();
  73. void effect_main_region__choice_0_tr1();
  74. void effect_main_region__choice_0_tr0();
  75. void enact_main_region_Start();
  76. void enseq_main_region_Start_default();
  77. void enseq_main_region_B_default();
  78. void enseq_main_region_A_default();
  79. void enseq_main_region_default();
  80. void exseq_main_region_Start();
  81. void exseq_main_region_B();
  82. void exseq_main_region_A();
  83. void exseq_main_region();
  84. void react_main_region_Start();
  85. void react_main_region_B();
  86. void react_main_region_A();
  87. void react_main_region__choice_0();
  88. void react_main_region__entry_Default();
  89. void clearInEvents();
  90. void clearOutEvents();
  91. };
  92. #endif /* STATICCHOICE_H_ */