OperationsWithoutBraces.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef OPERATIONSWITHOUTBRACES_H_
  2. #define OPERATIONSWITHOUTBRACES_H_
  3. #include "sc_types.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*! \file Header of the state machine 'OperationsWithoutBraces'.
  8. */
  9. /*! Enumeration of all states */
  10. typedef enum
  11. {
  12. OperationsWithoutBraces_main_region_A,
  13. OperationsWithoutBraces_main_region_B,
  14. OperationsWithoutBraces_main_region_C,
  15. OperationsWithoutBraces_main_region_D,
  16. OperationsWithoutBraces_another_region_A,
  17. OperationsWithoutBraces_another_region_B,
  18. OperationsWithoutBraces_another_region_C,
  19. OperationsWithoutBraces_another_region_D,
  20. OperationsWithoutBraces_last_state
  21. } OperationsWithoutBracesStates;
  22. /*! Define dimension of the state configuration vector for orthogonal states. */
  23. #define OPERATIONSWITHOUTBRACES_MAX_ORTHOGONAL_STATES 2
  24. /*!
  25. * Type definition of the data structure for the OperationsWithoutBraces state machine.
  26. * This data structure has to be allocated by the client code.
  27. */
  28. typedef struct
  29. {
  30. OperationsWithoutBracesStates stateConfVector[OPERATIONSWITHOUTBRACES_MAX_ORTHOGONAL_STATES];
  31. sc_ushort stateConfVectorPosition;
  32. } OperationsWithoutBraces;
  33. /*! Initializes the OperationsWithoutBraces state machine data structures. Must be called before first usage.*/
  34. extern void operationsWithoutBraces_init(OperationsWithoutBraces* handle);
  35. /*! Activates the state machine */
  36. extern void operationsWithoutBraces_enter(OperationsWithoutBraces* handle);
  37. /*! Deactivates the state machine */
  38. extern void operationsWithoutBraces_exit(OperationsWithoutBraces* handle);
  39. /*! Performs a 'run to completion' step. */
  40. extern void operationsWithoutBraces_runCycle(OperationsWithoutBraces* handle);
  41. /*!
  42. * Checks whether the state machine is active (until 2.4.1 this method was used for states).
  43. * 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.
  44. */
  45. extern sc_boolean operationsWithoutBraces_isActive(const OperationsWithoutBraces* handle);
  46. /*!
  47. * Checks if all active states are final.
  48. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  49. */
  50. extern sc_boolean operationsWithoutBraces_isFinal(const OperationsWithoutBraces* handle);
  51. /*! Checks if the specified state is active (until 2.4.1 the used method for states was called isActive()). */
  52. extern sc_boolean operationsWithoutBraces_isStateActive(const OperationsWithoutBraces* handle, OperationsWithoutBracesStates state);
  53. #ifdef __cplusplus
  54. }
  55. #endif
  56. #endif /* OPERATIONSWITHOUTBRACES_H_ */