FeatureCalls.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #ifndef FEATURECALLS_H_
  2. #define FEATURECALLS_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'FeatureCalls'.
  6. */
  7. class FeatureCalls : public StatemachineInterface
  8. {
  9. public:
  10. FeatureCalls();
  11. ~FeatureCalls();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. main_region_A,
  16. main_region_B,
  17. FeatureCalls_last_state
  18. } FeatureCallsStates;
  19. //! Inner class for MyInterface interface scope.
  20. class SCI_MyInterface
  21. {
  22. public:
  23. /*! Raises the in event 'Event1' that is defined in the interface scope 'MyInterface'. */
  24. void raise_event1();
  25. /*! Gets the value of the variable 'myInt' that is defined in the interface scope 'MyInterface'. */
  26. sc_integer get_myInt() const;
  27. /*! Sets the value of the variable 'myInt' that is defined in the interface scope 'MyInterface'. */
  28. void set_myInt(sc_integer value);
  29. private:
  30. friend class FeatureCalls;
  31. sc_boolean Event1_raised;
  32. sc_integer myInt;
  33. };
  34. /*! Returns an instance of the interface class 'SCI_MyInterface'. */
  35. SCI_MyInterface* getSCI_MyInterface();
  36. /*
  37. * Functions inherited from StatemachineInterface
  38. */
  39. virtual void init();
  40. virtual void enter();
  41. virtual void exit();
  42. virtual void runCycle();
  43. /*!
  44. * Checks if the state machine is active (until 2.4.1 this method was used for states).
  45. * 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.
  46. */
  47. virtual sc_boolean isActive() const;
  48. /*!
  49. * Checks if all active states are final.
  50. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  51. */
  52. virtual sc_boolean isFinal() const;
  53. /*! Checks if the specified state is active (until 2.4.1 the used method for states was calles isActive()). */
  54. sc_boolean isStateActive(FeatureCallsStates state) const;
  55. private:
  56. //! the maximum number of orthogonal states defines the dimension of the state configuration vector.
  57. static const sc_integer maxOrthogonalStates = 1;
  58. FeatureCallsStates stateConfVector[maxOrthogonalStates];
  59. sc_ushort stateConfVectorPosition;
  60. SCI_MyInterface ifaceMyInterface;
  61. // prototypes of all internal functions
  62. sc_boolean check_main_region_A_tr0_tr0();
  63. sc_boolean check_main_region_B_tr0_tr0();
  64. void effect_main_region_A_tr0();
  65. void effect_main_region_B_tr0();
  66. void enact_main_region_B();
  67. void enseq_main_region_A_default();
  68. void enseq_main_region_B_default();
  69. void enseq_main_region_default();
  70. void exseq_main_region_A();
  71. void exseq_main_region_B();
  72. void exseq_main_region();
  73. void react_main_region_A();
  74. void react_main_region_B();
  75. void react_main_region__entry_Default();
  76. void clearInEvents();
  77. void clearOutEvents();
  78. };
  79. #endif /* FEATURECALLS_H_ */