IntegerExpressions.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. #ifndef INTEGEREXPRESSIONS_H_
  2. #define INTEGEREXPRESSIONS_H_
  3. #include "sc_types.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*! \file Header of the state machine 'IntegerExpressions'.
  8. */
  9. /*! Enumeration of all states */
  10. typedef enum
  11. {
  12. IntegerExpressions_main_region_StateA,
  13. IntegerExpressions_main_region_StateB,
  14. IntegerExpressions_last_state
  15. } IntegerExpressionsStates;
  16. /*! Type definition of the data structure for the IntegerExpressionsIface interface scope. */
  17. typedef struct
  18. {
  19. sc_integer myInt1;
  20. sc_integer myInt2;
  21. sc_boolean less;
  22. sc_boolean greater;
  23. sc_boolean equalOrLess;
  24. sc_boolean equalOrGreater;
  25. sc_boolean equal;
  26. sc_boolean notEqual;
  27. sc_integer plus;
  28. sc_integer minus;
  29. sc_integer multiply;
  30. sc_integer division;
  31. sc_integer modulo;
  32. sc_integer negat;
  33. sc_boolean complement;
  34. sc_integer multiAssign;
  35. sc_integer divAssign;
  36. sc_integer plusAssign;
  37. sc_integer minusAssign;
  38. sc_integer moduloAssign;
  39. sc_boolean e1_raised;
  40. } IntegerExpressionsIface;
  41. /*! Define dimension of the state configuration vector for orthogonal states. */
  42. #define INTEGEREXPRESSIONS_MAX_ORTHOGONAL_STATES 1
  43. /*!
  44. * Type definition of the data structure for the IntegerExpressions state machine.
  45. * This data structure has to be allocated by the client code.
  46. */
  47. typedef struct
  48. {
  49. IntegerExpressionsStates stateConfVector[INTEGEREXPRESSIONS_MAX_ORTHOGONAL_STATES];
  50. sc_ushort stateConfVectorPosition;
  51. IntegerExpressionsIface iface;
  52. } IntegerExpressions;
  53. /*! Initializes the IntegerExpressions state machine data structures. Must be called before first usage.*/
  54. extern void integerExpressions_init(IntegerExpressions* handle);
  55. /*! Activates the state machine */
  56. extern void integerExpressions_enter(IntegerExpressions* handle);
  57. /*! Deactivates the state machine */
  58. extern void integerExpressions_exit(IntegerExpressions* handle);
  59. /*! Performs a 'run to completion' step. */
  60. extern void integerExpressions_runCycle(IntegerExpressions* handle);
  61. /*! Gets the value of the variable 'myInt1' that is defined in the default interface scope. */
  62. extern sc_integer integerExpressionsIface_get_myInt1(const IntegerExpressions* handle);
  63. /*! Sets the value of the variable 'myInt1' that is defined in the default interface scope. */
  64. extern void integerExpressionsIface_set_myInt1(IntegerExpressions* handle, sc_integer value);
  65. /*! Gets the value of the variable 'myInt2' that is defined in the default interface scope. */
  66. extern sc_integer integerExpressionsIface_get_myInt2(const IntegerExpressions* handle);
  67. /*! Sets the value of the variable 'myInt2' that is defined in the default interface scope. */
  68. extern void integerExpressionsIface_set_myInt2(IntegerExpressions* handle, sc_integer value);
  69. /*! Gets the value of the variable 'less' that is defined in the default interface scope. */
  70. extern sc_boolean integerExpressionsIface_get_less(const IntegerExpressions* handle);
  71. /*! Sets the value of the variable 'less' that is defined in the default interface scope. */
  72. extern void integerExpressionsIface_set_less(IntegerExpressions* handle, sc_boolean value);
  73. /*! Gets the value of the variable 'greater' that is defined in the default interface scope. */
  74. extern sc_boolean integerExpressionsIface_get_greater(const IntegerExpressions* handle);
  75. /*! Sets the value of the variable 'greater' that is defined in the default interface scope. */
  76. extern void integerExpressionsIface_set_greater(IntegerExpressions* handle, sc_boolean value);
  77. /*! Gets the value of the variable 'equalOrLess' that is defined in the default interface scope. */
  78. extern sc_boolean integerExpressionsIface_get_equalOrLess(const IntegerExpressions* handle);
  79. /*! Sets the value of the variable 'equalOrLess' that is defined in the default interface scope. */
  80. extern void integerExpressionsIface_set_equalOrLess(IntegerExpressions* handle, sc_boolean value);
  81. /*! Gets the value of the variable 'equalOrGreater' that is defined in the default interface scope. */
  82. extern sc_boolean integerExpressionsIface_get_equalOrGreater(const IntegerExpressions* handle);
  83. /*! Sets the value of the variable 'equalOrGreater' that is defined in the default interface scope. */
  84. extern void integerExpressionsIface_set_equalOrGreater(IntegerExpressions* handle, sc_boolean value);
  85. /*! Gets the value of the variable 'equal' that is defined in the default interface scope. */
  86. extern sc_boolean integerExpressionsIface_get_equal(const IntegerExpressions* handle);
  87. /*! Sets the value of the variable 'equal' that is defined in the default interface scope. */
  88. extern void integerExpressionsIface_set_equal(IntegerExpressions* handle, sc_boolean value);
  89. /*! Gets the value of the variable 'notEqual' that is defined in the default interface scope. */
  90. extern sc_boolean integerExpressionsIface_get_notEqual(const IntegerExpressions* handle);
  91. /*! Sets the value of the variable 'notEqual' that is defined in the default interface scope. */
  92. extern void integerExpressionsIface_set_notEqual(IntegerExpressions* handle, sc_boolean value);
  93. /*! Gets the value of the variable 'plus' that is defined in the default interface scope. */
  94. extern sc_integer integerExpressionsIface_get_plus(const IntegerExpressions* handle);
  95. /*! Sets the value of the variable 'plus' that is defined in the default interface scope. */
  96. extern void integerExpressionsIface_set_plus(IntegerExpressions* handle, sc_integer value);
  97. /*! Gets the value of the variable 'minus' that is defined in the default interface scope. */
  98. extern sc_integer integerExpressionsIface_get_minus(const IntegerExpressions* handle);
  99. /*! Sets the value of the variable 'minus' that is defined in the default interface scope. */
  100. extern void integerExpressionsIface_set_minus(IntegerExpressions* handle, sc_integer value);
  101. /*! Gets the value of the variable 'multiply' that is defined in the default interface scope. */
  102. extern sc_integer integerExpressionsIface_get_multiply(const IntegerExpressions* handle);
  103. /*! Sets the value of the variable 'multiply' that is defined in the default interface scope. */
  104. extern void integerExpressionsIface_set_multiply(IntegerExpressions* handle, sc_integer value);
  105. /*! Gets the value of the variable 'division' that is defined in the default interface scope. */
  106. extern sc_integer integerExpressionsIface_get_division(const IntegerExpressions* handle);
  107. /*! Sets the value of the variable 'division' that is defined in the default interface scope. */
  108. extern void integerExpressionsIface_set_division(IntegerExpressions* handle, sc_integer value);
  109. /*! Gets the value of the variable 'modulo' that is defined in the default interface scope. */
  110. extern sc_integer integerExpressionsIface_get_modulo(const IntegerExpressions* handle);
  111. /*! Sets the value of the variable 'modulo' that is defined in the default interface scope. */
  112. extern void integerExpressionsIface_set_modulo(IntegerExpressions* handle, sc_integer value);
  113. /*! Gets the value of the variable 'negat' that is defined in the default interface scope. */
  114. extern sc_integer integerExpressionsIface_get_negat(const IntegerExpressions* handle);
  115. /*! Sets the value of the variable 'negat' that is defined in the default interface scope. */
  116. extern void integerExpressionsIface_set_negat(IntegerExpressions* handle, sc_integer value);
  117. /*! Gets the value of the variable 'complement' that is defined in the default interface scope. */
  118. extern sc_boolean integerExpressionsIface_get_complement(const IntegerExpressions* handle);
  119. /*! Sets the value of the variable 'complement' that is defined in the default interface scope. */
  120. extern void integerExpressionsIface_set_complement(IntegerExpressions* handle, sc_boolean value);
  121. /*! Gets the value of the variable 'multiAssign' that is defined in the default interface scope. */
  122. extern sc_integer integerExpressionsIface_get_multiAssign(const IntegerExpressions* handle);
  123. /*! Sets the value of the variable 'multiAssign' that is defined in the default interface scope. */
  124. extern void integerExpressionsIface_set_multiAssign(IntegerExpressions* handle, sc_integer value);
  125. /*! Gets the value of the variable 'divAssign' that is defined in the default interface scope. */
  126. extern sc_integer integerExpressionsIface_get_divAssign(const IntegerExpressions* handle);
  127. /*! Sets the value of the variable 'divAssign' that is defined in the default interface scope. */
  128. extern void integerExpressionsIface_set_divAssign(IntegerExpressions* handle, sc_integer value);
  129. /*! Gets the value of the variable 'plusAssign' that is defined in the default interface scope. */
  130. extern sc_integer integerExpressionsIface_get_plusAssign(const IntegerExpressions* handle);
  131. /*! Sets the value of the variable 'plusAssign' that is defined in the default interface scope. */
  132. extern void integerExpressionsIface_set_plusAssign(IntegerExpressions* handle, sc_integer value);
  133. /*! Gets the value of the variable 'minusAssign' that is defined in the default interface scope. */
  134. extern sc_integer integerExpressionsIface_get_minusAssign(const IntegerExpressions* handle);
  135. /*! Sets the value of the variable 'minusAssign' that is defined in the default interface scope. */
  136. extern void integerExpressionsIface_set_minusAssign(IntegerExpressions* handle, sc_integer value);
  137. /*! Gets the value of the variable 'moduloAssign' that is defined in the default interface scope. */
  138. extern sc_integer integerExpressionsIface_get_moduloAssign(const IntegerExpressions* handle);
  139. /*! Sets the value of the variable 'moduloAssign' that is defined in the default interface scope. */
  140. extern void integerExpressionsIface_set_moduloAssign(IntegerExpressions* handle, sc_integer value);
  141. /*! Raises the in event 'e1' that is defined in the default interface scope. */
  142. extern void integerExpressionsIface_raise_e1(IntegerExpressions* handle);
  143. /*!
  144. * Checks whether the state machine is active (until 2.4.1 this method was used for states).
  145. * A state machine is active if it was entered. It is inactive if it has not been entered at all or if it has been exited.
  146. */
  147. extern sc_boolean integerExpressions_isActive(const IntegerExpressions* handle);
  148. /*!
  149. * Checks if all active states are final.
  150. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  151. */
  152. extern sc_boolean integerExpressions_isFinal(const IntegerExpressions* handle);
  153. /*! Checks if the specified state is active (until 2.4.1 the used method for states was called isActive()). */
  154. extern sc_boolean integerExpressions_isStateActive(const IntegerExpressions* handle, IntegerExpressionsStates state);
  155. #ifdef __cplusplus
  156. }
  157. #endif
  158. #endif /* INTEGEREXPRESSIONS_H_ */