SameNameDifferentRegion.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef SAMENAMEDIFFERENTREGION_H_
  2. #define SAMENAMEDIFFERENTREGION_H_
  3. #include "sc_types.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*! \file Header of the state machine 'SameNameDifferentRegion'.
  8. */
  9. /*! Enumeration of all states */
  10. typedef enum
  11. {
  12. SameNameDifferentRegion_last_state,
  13. SameNameDifferentRegion_main_region_StateA,
  14. SameNameDifferentRegion_main_region_StateB,
  15. SameNameDifferentRegion_main_region_StateB_r1_StateA,
  16. SameNameDifferentRegion_main_region_StateB_r1_StateB
  17. } SameNameDifferentRegionStates;
  18. /*! Type definition of the data structure for the SameNameDifferentRegionIface interface scope. */
  19. typedef struct
  20. {
  21. sc_boolean e1_raised;
  22. } SameNameDifferentRegionIface;
  23. /*! Define dimension of the state configuration vector for orthogonal states. */
  24. #define SAMENAMEDIFFERENTREGION_MAX_ORTHOGONAL_STATES 1
  25. /*! Define indices of states in the StateConfVector */
  26. #define SCVI_SAMENAMEDIFFERENTREGION_MAIN_REGION_STATEA 0
  27. #define SCVI_SAMENAMEDIFFERENTREGION_MAIN_REGION_STATEB 0
  28. #define SCVI_SAMENAMEDIFFERENTREGION_MAIN_REGION_STATEB_R1_STATEA 0
  29. #define SCVI_SAMENAMEDIFFERENTREGION_MAIN_REGION_STATEB_R1_STATEB 0
  30. /*!
  31. * Type definition of the data structure for the SameNameDifferentRegion state machine.
  32. * This data structure has to be allocated by the client code.
  33. */
  34. typedef struct
  35. {
  36. SameNameDifferentRegionStates stateConfVector[SAMENAMEDIFFERENTREGION_MAX_ORTHOGONAL_STATES];
  37. sc_ushort stateConfVectorPosition;
  38. SameNameDifferentRegionIface iface;
  39. } SameNameDifferentRegion;
  40. /*! Initializes the SameNameDifferentRegion state machine data structures. Must be called before first usage.*/
  41. extern void sameNameDifferentRegion_init(SameNameDifferentRegion* handle);
  42. /*! Activates the state machine */
  43. extern void sameNameDifferentRegion_enter(SameNameDifferentRegion* handle);
  44. /*! Deactivates the state machine */
  45. extern void sameNameDifferentRegion_exit(SameNameDifferentRegion* handle);
  46. /*! Performs a 'run to completion' step. */
  47. extern void sameNameDifferentRegion_runCycle(SameNameDifferentRegion* handle);
  48. /*! Raises the in event 'e1' that is defined in the default interface scope. */
  49. extern void sameNameDifferentRegionIface_raise_e1(SameNameDifferentRegion* handle);
  50. /*!
  51. * Checks whether the state machine is active (until 2.4.1 this method was used for states).
  52. * 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.
  53. */
  54. extern sc_boolean sameNameDifferentRegion_isActive(const SameNameDifferentRegion* handle);
  55. /*!
  56. * Checks if all active states are final.
  57. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  58. */
  59. extern sc_boolean sameNameDifferentRegion_isFinal(const SameNameDifferentRegion* handle);
  60. /*! Checks if the specified state is active (until 2.4.1 the used method for states was called isActive()). */
  61. extern sc_boolean sameNameDifferentRegion_isStateActive(const SameNameDifferentRegion* handle, SameNameDifferentRegionStates state);
  62. #ifdef __cplusplus
  63. }
  64. #endif
  65. #endif /* SAMENAMEDIFFERENTREGION_H_ */