FeatureCalls.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #ifndef FEATURECALLS_H_
  2. #define FEATURECALLS_H_
  3. #include "sc_types.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*! \file Header of the state machine 'FeatureCalls'.
  8. */
  9. /*! Enumeration of all states */
  10. typedef enum
  11. {
  12. FeatureCalls_main_region_A,
  13. FeatureCalls_main_region_B,
  14. FeatureCalls_last_state
  15. } FeatureCallsStates;
  16. /*! Type definition of the data structure for the FeatureCallsIfaceMyInterface interface scope. */
  17. typedef struct
  18. {
  19. sc_boolean Event1_raised;
  20. sc_integer myInt;
  21. } FeatureCallsIfaceMyInterface;
  22. /*! Define dimension of the state configuration vector for orthogonal states. */
  23. #define FEATURECALLS_MAX_ORTHOGONAL_STATES 1
  24. /*!
  25. * Type definition of the data structure for the FeatureCalls state machine.
  26. * This data structure has to be allocated by the client code.
  27. */
  28. typedef struct
  29. {
  30. FeatureCallsStates stateConfVector[FEATURECALLS_MAX_ORTHOGONAL_STATES];
  31. sc_ushort stateConfVectorPosition;
  32. FeatureCallsIfaceMyInterface ifaceMyInterface;
  33. } FeatureCalls;
  34. /*! Initializes the FeatureCalls state machine data structures. Must be called before first usage.*/
  35. extern void featureCalls_init(FeatureCalls* handle);
  36. /*! Activates the state machine */
  37. extern void featureCalls_enter(FeatureCalls* handle);
  38. /*! Deactivates the state machine */
  39. extern void featureCalls_exit(FeatureCalls* handle);
  40. /*! Performs a 'run to completion' step. */
  41. extern void featureCalls_runCycle(FeatureCalls* handle);
  42. /*! Raises the in event 'Event1' that is defined in the interface scope 'MyInterface'. */
  43. extern void featureCallsIfaceMyInterface_raise_event1(FeatureCalls* handle);
  44. /*! Gets the value of the variable 'myInt' that is defined in the interface scope 'MyInterface'. */
  45. extern sc_integer featureCallsIfaceMyInterface_get_myInt(const FeatureCalls* handle);
  46. /*! Sets the value of the variable 'myInt' that is defined in the interface scope 'MyInterface'. */
  47. extern void featureCallsIfaceMyInterface_set_myInt(FeatureCalls* handle, sc_integer value);
  48. /*!
  49. * Checks whether the state machine is active (until 2.4.1 this method was used for states).
  50. * 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.
  51. */
  52. extern sc_boolean featureCalls_isActive(const FeatureCalls* handle);
  53. /*!
  54. * Checks if all active states are final.
  55. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  56. */
  57. extern sc_boolean featureCalls_isFinal(const FeatureCalls* handle);
  58. /*! Checks if the specified state is active (until 2.4.1 the used method for states was called isActive()). */
  59. extern sc_boolean featureCalls_isStateActive(const FeatureCalls* handle, FeatureCallsStates state);
  60. #ifdef __cplusplus
  61. }
  62. #endif
  63. #endif /* FEATURECALLS_H_ */