HistoryWithoutInitialStep.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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_last_state,
  13. HistoryWithoutInitialStep_main_region_A,
  14. HistoryWithoutInitialStep_main_region_B,
  15. HistoryWithoutInitialStep_main_region_B_r1_C,
  16. HistoryWithoutInitialStep_main_region_B_r1_D,
  17. HistoryWithoutInitialStep_main_region_B_r1_E,
  18. HistoryWithoutInitialStep_main_region_B_r1_E__region0_F
  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. /*! Define indices of states in the StateConfVector */
  33. #define SCVI_HISTORYWITHOUTINITIALSTEP_MAIN_REGION_A 0
  34. #define SCVI_HISTORYWITHOUTINITIALSTEP_MAIN_REGION_B 0
  35. #define SCVI_HISTORYWITHOUTINITIALSTEP_MAIN_REGION_B_R1_C 0
  36. #define SCVI_HISTORYWITHOUTINITIALSTEP_MAIN_REGION_B_R1_D 0
  37. #define SCVI_HISTORYWITHOUTINITIALSTEP_MAIN_REGION_B_R1_E 0
  38. #define SCVI_HISTORYWITHOUTINITIALSTEP_MAIN_REGION_B_R1_E__REGION0_F 0
  39. /*!
  40. * Type definition of the data structure for the HistoryWithoutInitialStep state machine.
  41. * This data structure has to be allocated by the client code.
  42. */
  43. typedef struct
  44. {
  45. HistoryWithoutInitialStepStates stateConfVector[HISTORYWITHOUTINITIALSTEP_MAX_ORTHOGONAL_STATES];
  46. HistoryWithoutInitialStepStates historyVector[HISTORYWITHOUTINITIALSTEP_MAX_HISTORY_STATES];
  47. sc_ushort stateConfVectorPosition;
  48. HistoryWithoutInitialStepIface iface;
  49. } HistoryWithoutInitialStep;
  50. /*! Initializes the HistoryWithoutInitialStep state machine data structures. Must be called before first usage.*/
  51. extern void historyWithoutInitialStep_init(HistoryWithoutInitialStep* handle);
  52. /*! Activates the state machine */
  53. extern void historyWithoutInitialStep_enter(HistoryWithoutInitialStep* handle);
  54. /*! Deactivates the state machine */
  55. extern void historyWithoutInitialStep_exit(HistoryWithoutInitialStep* handle);
  56. /*! Performs a 'run to completion' step. */
  57. extern void historyWithoutInitialStep_runCycle(HistoryWithoutInitialStep* handle);
  58. /*! Raises the in event 'toA' that is defined in the default interface scope. */
  59. extern void historyWithoutInitialStepIface_raise_toA(HistoryWithoutInitialStep* handle);
  60. /*! Raises the in event 'toB' that is defined in the default interface scope. */
  61. extern void historyWithoutInitialStepIface_raise_toB(HistoryWithoutInitialStep* handle);
  62. /*! Raises the in event 'toHistory' that is defined in the default interface scope. */
  63. extern void historyWithoutInitialStepIface_raise_toHistory(HistoryWithoutInitialStep* handle);
  64. /*! Raises the in event 'next' that is defined in the default interface scope. */
  65. extern void historyWithoutInitialStepIface_raise_next(HistoryWithoutInitialStep* handle);
  66. /*!
  67. * Checks whether the state machine is active (until 2.4.1 this method was used for states).
  68. * 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.
  69. */
  70. extern sc_boolean historyWithoutInitialStep_isActive(const HistoryWithoutInitialStep* handle);
  71. /*!
  72. * Checks if all active states are final.
  73. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  74. */
  75. extern sc_boolean historyWithoutInitialStep_isFinal(const HistoryWithoutInitialStep* handle);
  76. /*! Checks if the specified state is active (until 2.4.1 the used method for states was called isActive()). */
  77. extern sc_boolean historyWithoutInitialStep_isStateActive(const HistoryWithoutInitialStep* handle, HistoryWithoutInitialStepStates state);
  78. #ifdef __cplusplus
  79. }
  80. #endif
  81. #endif /* HISTORYWITHOUTINITIALSTEP_H_ */