LogicalOr.h 3.2 KB

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