CastExpressions.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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_last_state,
  13. CastExpressions_main_region_A,
  14. CastExpressions_main_region_B,
  15. CastExpressions_main_region_C
  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. /*! Define indices of states in the StateConfVector */
  26. #define SCVI_CASTEXPRESSIONS_MAIN_REGION_A 0
  27. #define SCVI_CASTEXPRESSIONS_MAIN_REGION_B 0
  28. #define SCVI_CASTEXPRESSIONS_MAIN_REGION_C 0
  29. /*!
  30. * Type definition of the data structure for the CastExpressions state machine.
  31. * This data structure has to be allocated by the client code.
  32. */
  33. typedef struct
  34. {
  35. CastExpressionsStates stateConfVector[CASTEXPRESSIONS_MAX_ORTHOGONAL_STATES];
  36. sc_ushort stateConfVectorPosition;
  37. CastExpressionsIface iface;
  38. } CastExpressions;
  39. /*! Initializes the CastExpressions state machine data structures. Must be called before first usage.*/
  40. extern void castExpressions_init(CastExpressions* handle);
  41. /*! Activates the state machine */
  42. extern void castExpressions_enter(CastExpressions* handle);
  43. /*! Deactivates the state machine */
  44. extern void castExpressions_exit(CastExpressions* handle);
  45. /*! Performs a 'run to completion' step. */
  46. extern void castExpressions_runCycle(CastExpressions* handle);
  47. /*! Gets the value of the variable 'realValue' that is defined in the default interface scope. */
  48. extern sc_real castExpressionsIface_get_realValue(const CastExpressions* handle);
  49. /*! Sets the value of the variable 'realValue' that is defined in the default interface scope. */
  50. extern void castExpressionsIface_set_realValue(CastExpressions* handle, sc_real value);
  51. /*! Gets the value of the variable 'intValue' that is defined in the default interface scope. */
  52. extern sc_integer castExpressionsIface_get_intValue(const CastExpressions* handle);
  53. /*! Sets the value of the variable 'intValue' that is defined in the default interface scope. */
  54. extern void castExpressionsIface_set_intValue(CastExpressions* handle, sc_integer value);
  55. /*!
  56. * Checks whether the state machine is active (until 2.4.1 this method was used for states).
  57. * 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.
  58. */
  59. extern sc_boolean castExpressions_isActive(const CastExpressions* handle);
  60. /*!
  61. * Checks if all active states are final.
  62. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  63. */
  64. extern sc_boolean castExpressions_isFinal(const CastExpressions* handle);
  65. /*! Checks if the specified state is active (until 2.4.1 the used method for states was called isActive()). */
  66. extern sc_boolean castExpressions_isStateActive(const CastExpressions* handle, CastExpressionsStates state);
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70. #endif /* CASTEXPRESSIONS_H_ */