NullCheck.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #ifndef NULLCHECK_H_
  2. #define NULLCHECK_H_
  3. #include "sc_types.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*! \file Header of the state machine 'NullCheck'.
  8. */
  9. /*! Enumeration of all states */
  10. typedef enum
  11. {
  12. NullCheck_main_region_A,
  13. NullCheck_main_region_B,
  14. NullCheck_last_state
  15. } NullCheckStates;
  16. /*! Define dimension of the state configuration vector for orthogonal states. */
  17. #define NULLCHECK_MAX_ORTHOGONAL_STATES 1
  18. /*!
  19. * Type definition of the data structure for the NullCheck state machine.
  20. * This data structure has to be allocated by the client code.
  21. */
  22. typedef struct
  23. {
  24. NullCheckStates stateConfVector[NULLCHECK_MAX_ORTHOGONAL_STATES];
  25. sc_ushort stateConfVectorPosition;
  26. } NullCheck;
  27. /*! Initializes the NullCheck state machine data structures. Must be called before first usage.*/
  28. extern void nullCheck_init(NullCheck* handle);
  29. /*! Activates the state machine */
  30. extern void nullCheck_enter(NullCheck* handle);
  31. /*! Deactivates the state machine */
  32. extern void nullCheck_exit(NullCheck* handle);
  33. /*! Performs a 'run to completion' step. */
  34. extern void nullCheck_runCycle(NullCheck* 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 nullCheck_isActive(const NullCheck* 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 nullCheck_isFinal(const NullCheck* 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 nullCheck_isStateActive(const NullCheck* handle, NullCheckStates state);
  47. #ifdef __cplusplus
  48. }
  49. #endif
  50. #endif /* NULLCHECK_H_ */