Parenthesis.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #ifndef PARENTHESIS_H_
  2. #define PARENTHESIS_H_
  3. #include "sc_types.h"
  4. #include "StatemachineInterface.h"
  5. /*! \file Header of the state machine 'Parenthesis'.
  6. */
  7. class Parenthesis : public StatemachineInterface
  8. {
  9. public:
  10. Parenthesis();
  11. ~Parenthesis();
  12. /*! Enumeration of all states */
  13. typedef enum
  14. {
  15. mainRegion_A,
  16. Parenthesis_last_state
  17. } ParenthesisStates;
  18. //! Inner class for default interface scope.
  19. class DefaultSCI
  20. {
  21. public:
  22. /*! Gets the value of the variable 'erg' that is defined in the default interface scope. */
  23. sc_integer get_erg() const;
  24. /*! Sets the value of the variable 'erg' that is defined in the default interface scope. */
  25. void set_erg(sc_integer value);
  26. private:
  27. friend class Parenthesis;
  28. sc_integer erg;
  29. };
  30. /*! Returns an instance of the interface class 'DefaultSCI'. */
  31. DefaultSCI* getDefaultSCI();
  32. /*! Gets the value of the variable 'erg' that is defined in the default interface scope. */
  33. sc_integer get_erg() const;
  34. /*! Sets the value of the variable 'erg' that is defined in the default interface scope. */
  35. void set_erg(sc_integer value);
  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(ParenthesisStates 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. ParenthesisStates stateConfVector[maxOrthogonalStates];
  59. sc_ushort stateConfVectorPosition;
  60. DefaultSCI iface;
  61. // prototypes of all internal functions
  62. void enact_mainRegion_A();
  63. void enseq_mainRegion_A_default();
  64. void enseq_mainRegion_default();
  65. void exseq_mainRegion_A();
  66. void exseq_mainRegion();
  67. void react_mainRegion_A();
  68. void react_mainRegion__entry_Default();
  69. void clearInEvents();
  70. void clearOutEvents();
  71. };
  72. #endif /* PARENTHESIS_H_ */