EntryExitSelfTransition.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #ifndef ENTRYEXITSELFTRANSITION_H_
  2. #define ENTRYEXITSELFTRANSITION_H_
  3. #include "sc_types.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*! \file Header of the state machine 'EntryExitSelfTransition'.
  8. */
  9. /*! Enumeration of all states */
  10. typedef enum
  11. {
  12. EntryExitSelfTransition_main_region_A,
  13. EntryExitSelfTransition_main_region_A__region0_B,
  14. EntryExitSelfTransition_main_region_A__region0_C,
  15. EntryExitSelfTransition_last_state
  16. } EntryExitSelfTransitionStates;
  17. /*! Type definition of the data structure for the EntryExitSelfTransitionIface interface scope. */
  18. typedef struct
  19. {
  20. sc_integer exits;
  21. sc_integer entries;
  22. sc_boolean e_raised;
  23. sc_boolean e1_raised;
  24. } EntryExitSelfTransitionIface;
  25. /*! Define dimension of the state configuration vector for orthogonal states. */
  26. #define ENTRYEXITSELFTRANSITION_MAX_ORTHOGONAL_STATES 1
  27. /*!
  28. * Type definition of the data structure for the EntryExitSelfTransition state machine.
  29. * This data structure has to be allocated by the client code.
  30. */
  31. typedef struct
  32. {
  33. EntryExitSelfTransitionStates stateConfVector[ENTRYEXITSELFTRANSITION_MAX_ORTHOGONAL_STATES];
  34. sc_ushort stateConfVectorPosition;
  35. EntryExitSelfTransitionIface iface;
  36. } EntryExitSelfTransition;
  37. /*! Initializes the EntryExitSelfTransition state machine data structures. Must be called before first usage.*/
  38. extern void entryExitSelfTransition_init(EntryExitSelfTransition* handle);
  39. /*! Activates the state machine */
  40. extern void entryExitSelfTransition_enter(EntryExitSelfTransition* handle);
  41. /*! Deactivates the state machine */
  42. extern void entryExitSelfTransition_exit(EntryExitSelfTransition* handle);
  43. /*! Performs a 'run to completion' step. */
  44. extern void entryExitSelfTransition_runCycle(EntryExitSelfTransition* handle);
  45. /*! Gets the value of the variable 'exits' that is defined in the default interface scope. */
  46. extern sc_integer entryExitSelfTransitionIface_get_exits(const EntryExitSelfTransition* handle);
  47. /*! Sets the value of the variable 'exits' that is defined in the default interface scope. */
  48. extern void entryExitSelfTransitionIface_set_exits(EntryExitSelfTransition* handle, sc_integer value);
  49. /*! Gets the value of the variable 'entries' that is defined in the default interface scope. */
  50. extern sc_integer entryExitSelfTransitionIface_get_entries(const EntryExitSelfTransition* handle);
  51. /*! Sets the value of the variable 'entries' that is defined in the default interface scope. */
  52. extern void entryExitSelfTransitionIface_set_entries(EntryExitSelfTransition* handle, sc_integer value);
  53. /*! Raises the in event 'e' that is defined in the default interface scope. */
  54. extern void entryExitSelfTransitionIface_raise_e(EntryExitSelfTransition* handle);
  55. /*! Raises the in event 'e1' that is defined in the default interface scope. */
  56. extern void entryExitSelfTransitionIface_raise_e1(EntryExitSelfTransition* handle);
  57. /*!
  58. * Checks whether the state machine is active (until 2.4.1 this method was used for states).
  59. * 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.
  60. */
  61. extern sc_boolean entryExitSelfTransition_isActive(const EntryExitSelfTransition* handle);
  62. /*!
  63. * Checks if all active states are final.
  64. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  65. */
  66. extern sc_boolean entryExitSelfTransition_isFinal(const EntryExitSelfTransition* handle);
  67. /*! Checks if the specified state is active (until 2.4.1 the used method for states was called isActive()). */
  68. extern sc_boolean entryExitSelfTransition_isStateActive(const EntryExitSelfTransition* handle, EntryExitSelfTransitionStates state);
  69. #ifdef __cplusplus
  70. }
  71. #endif
  72. #endif /* ENTRYEXITSELFTRANSITION_H_ */