EmptyTransition.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #ifndef EMPTYTRANSITION_H_
  2. #define EMPTYTRANSITION_H_
  3. #include "sc_types.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*! \file Header of the state machine 'EmptyTransition'.
  8. */
  9. /*! Enumeration of all states */
  10. typedef enum
  11. {
  12. EmptyTransition_main_region_A,
  13. EmptyTransition_main_region_B,
  14. EmptyTransition_last_state
  15. } EmptyTransitionStates;
  16. /*! Define dimension of the state configuration vector for orthogonal states. */
  17. #define EMPTYTRANSITION_MAX_ORTHOGONAL_STATES 1
  18. /*!
  19. * Type definition of the data structure for the EmptyTransition state machine.
  20. * This data structure has to be allocated by the client code.
  21. */
  22. typedef struct
  23. {
  24. EmptyTransitionStates stateConfVector[EMPTYTRANSITION_MAX_ORTHOGONAL_STATES];
  25. sc_ushort stateConfVectorPosition;
  26. } EmptyTransition;
  27. /*! Initializes the EmptyTransition state machine data structures. Must be called before first usage.*/
  28. extern void emptyTransition_init(EmptyTransition* handle);
  29. /*! Activates the state machine */
  30. extern void emptyTransition_enter(EmptyTransition* handle);
  31. /*! Deactivates the state machine */
  32. extern void emptyTransition_exit(EmptyTransition* handle);
  33. /*! Performs a 'run to completion' step. */
  34. extern void emptyTransition_runCycle(EmptyTransition* handle);
  35. /*!
  36. * Checks whether the state machine is active (until 2.4.1 this method was used for states).
  37. * 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.
  38. */
  39. extern sc_boolean emptyTransition_isActive(const EmptyTransition* handle);
  40. /*!
  41. * Checks if all active states are final.
  42. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  43. */
  44. extern sc_boolean emptyTransition_isFinal(const EmptyTransition* handle);
  45. /*! Checks if the specified state is active (until 2.4.1 the used method for states was called isActive()). */
  46. extern sc_boolean emptyTransition_isStateActive(const EmptyTransition* handle, EmptyTransitionStates state);
  47. #ifdef __cplusplus
  48. }
  49. #endif
  50. #endif /* EMPTYTRANSITION_H_ */