HistoryWithoutInitialStep.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #ifndef HISTORYWITHOUTINITIALSTEP_H_
  2. #define HISTORYWITHOUTINITIALSTEP_H_
  3. #include "sc_types.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*! \file Header of the state machine 'HistoryWithoutInitialStep'.
  8. */
  9. /*! Enumeration of all states */
  10. typedef enum
  11. {
  12. HistoryWithoutInitialStep_main_region_A,
  13. HistoryWithoutInitialStep_main_region_B,
  14. HistoryWithoutInitialStep_main_region_B_r1_C,
  15. HistoryWithoutInitialStep_main_region_B_r1_D,
  16. HistoryWithoutInitialStep_main_region_B_r1_E,
  17. HistoryWithoutInitialStep_main_region_B_r1_E__region0_F,
  18. HistoryWithoutInitialStep_last_state
  19. } HistoryWithoutInitialStepStates;
  20. /*! Type definition of the data structure for the HistoryWithoutInitialStepIface interface scope. */
  21. typedef struct
  22. {
  23. sc_boolean toA_raised;
  24. sc_boolean toB_raised;
  25. sc_boolean toHistory_raised;
  26. sc_boolean next_raised;
  27. } HistoryWithoutInitialStepIface;
  28. /*! Define dimension of the state configuration vector for orthogonal states. */
  29. #define HISTORYWITHOUTINITIALSTEP_MAX_ORTHOGONAL_STATES 1
  30. /*! Define dimension of the state configuration vector for history states. */
  31. #define HISTORYWITHOUTINITIALSTEP_MAX_HISTORY_STATES 1
  32. /*!
  33. * Type definition of the data structure for the HistoryWithoutInitialStep state machine.
  34. * This data structure has to be allocated by the client code.
  35. */
  36. typedef struct
  37. {
  38. HistoryWithoutInitialStepStates stateConfVector[HISTORYWITHOUTINITIALSTEP_MAX_ORTHOGONAL_STATES];
  39. HistoryWithoutInitialStepStates historyVector[HISTORYWITHOUTINITIALSTEP_MAX_HISTORY_STATES];
  40. sc_ushort stateConfVectorPosition;
  41. HistoryWithoutInitialStepIface iface;
  42. } HistoryWithoutInitialStep;
  43. /*! Initializes the HistoryWithoutInitialStep state machine data structures. Must be called before first usage.*/
  44. extern void historyWithoutInitialStep_init(HistoryWithoutInitialStep* handle);
  45. /*! Activates the state machine */
  46. extern void historyWithoutInitialStep_enter(HistoryWithoutInitialStep* handle);
  47. /*! Deactivates the state machine */
  48. extern void historyWithoutInitialStep_exit(HistoryWithoutInitialStep* handle);
  49. /*! Performs a 'run to completion' step. */
  50. extern void historyWithoutInitialStep_runCycle(HistoryWithoutInitialStep* handle);
  51. /*! Raises the in event 'toA' that is defined in the default interface scope. */
  52. extern void historyWithoutInitialStepIface_raise_toA(HistoryWithoutInitialStep* handle);
  53. /*! Raises the in event 'toB' that is defined in the default interface scope. */
  54. extern void historyWithoutInitialStepIface_raise_toB(HistoryWithoutInitialStep* handle);
  55. /*! Raises the in event 'toHistory' that is defined in the default interface scope. */
  56. extern void historyWithoutInitialStepIface_raise_toHistory(HistoryWithoutInitialStep* handle);
  57. /*! Raises the in event 'next' that is defined in the default interface scope. */
  58. extern void historyWithoutInitialStepIface_raise_next(HistoryWithoutInitialStep* handle);
  59. /*!
  60. * Checks whether the state machine is active (until 2.4.1 this method was used for states).
  61. * 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.
  62. */
  63. extern sc_boolean historyWithoutInitialStep_isActive(const HistoryWithoutInitialStep* handle);
  64. /*!
  65. * Checks if all active states are final.
  66. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  67. */
  68. extern sc_boolean historyWithoutInitialStep_isFinal(const HistoryWithoutInitialStep* handle);
  69. /*! Checks if the specified state is active (until 2.4.1 the used method for states was called isActive()). */
  70. extern sc_boolean historyWithoutInitialStep_isStateActive(const HistoryWithoutInitialStep* handle, HistoryWithoutInitialStepStates state);
  71. #ifdef __cplusplus
  72. }
  73. #endif
  74. #endif /* HISTORYWITHOUTINITIALSTEP_H_ */