CastExpressions.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #ifndef CASTEXPRESSIONS_H_
  2. #define CASTEXPRESSIONS_H_
  3. #include "sc_types.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*! \file Header of the state machine 'CastExpressions'.
  8. */
  9. /*! Enumeration of all states */
  10. typedef enum
  11. {
  12. CastExpressions_main_region_A,
  13. CastExpressions_main_region_B,
  14. CastExpressions_main_region_C,
  15. CastExpressions_last_state
  16. } CastExpressionsStates;
  17. /*! Type definition of the data structure for the CastExpressionsIface interface scope. */
  18. typedef struct
  19. {
  20. sc_real realValue;
  21. sc_integer intValue;
  22. } CastExpressionsIface;
  23. /*! Define dimension of the state configuration vector for orthogonal states. */
  24. #define CASTEXPRESSIONS_MAX_ORTHOGONAL_STATES 1
  25. /*!
  26. * Type definition of the data structure for the CastExpressions state machine.
  27. * This data structure has to be allocated by the client code.
  28. */
  29. typedef struct
  30. {
  31. CastExpressionsStates stateConfVector[CASTEXPRESSIONS_MAX_ORTHOGONAL_STATES];
  32. sc_ushort stateConfVectorPosition;
  33. CastExpressionsIface iface;
  34. } CastExpressions;
  35. /*! Initializes the CastExpressions state machine data structures. Must be called before first usage.*/
  36. extern void castExpressions_init(CastExpressions* handle);
  37. /*! Activates the state machine */
  38. extern void castExpressions_enter(CastExpressions* handle);
  39. /*! Deactivates the state machine */
  40. extern void castExpressions_exit(CastExpressions* handle);
  41. /*! Performs a 'run to completion' step. */
  42. extern void castExpressions_runCycle(CastExpressions* handle);
  43. /*! Gets the value of the variable 'realValue' that is defined in the default interface scope. */
  44. extern sc_real castExpressionsIface_get_realValue(const CastExpressions* handle);
  45. /*! Sets the value of the variable 'realValue' that is defined in the default interface scope. */
  46. extern void castExpressionsIface_set_realValue(CastExpressions* handle, sc_real value);
  47. /*! Gets the value of the variable 'intValue' that is defined in the default interface scope. */
  48. extern sc_integer castExpressionsIface_get_intValue(const CastExpressions* handle);
  49. /*! Sets the value of the variable 'intValue' that is defined in the default interface scope. */
  50. extern void castExpressionsIface_set_intValue(CastExpressions* handle, sc_integer value);
  51. /*!
  52. * Checks whether the state machine is active (until 2.4.1 this method was used for states).
  53. * 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.
  54. */
  55. extern sc_boolean castExpressions_isActive(const CastExpressions* handle);
  56. /*!
  57. * Checks if all active states are final.
  58. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  59. */
  60. extern sc_boolean castExpressions_isFinal(const CastExpressions* handle);
  61. /*! Checks if the specified state is active (until 2.4.1 the used method for states was called isActive()). */
  62. extern sc_boolean castExpressions_isStateActive(const CastExpressions* handle, CastExpressionsStates state);
  63. #ifdef __cplusplus
  64. }
  65. #endif
  66. #endif /* CASTEXPRESSIONS_H_ */