ConstOnlyInternalScope.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #ifndef CONSTONLYINTERNALSCOPE_H_
  2. #define CONSTONLYINTERNALSCOPE_H_
  3. #include "sc_types.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*! \file Header of the state machine 'ConstOnlyInternalScope'.
  8. */
  9. /*! Enumeration of all states */
  10. typedef enum
  11. {
  12. ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_A,
  13. ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_B,
  14. ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_C,
  15. ConstOnlyInternalScope_last_state
  16. } ConstOnlyInternalScopeStates;
  17. /*! Type definition of the data structure for the ConstOnlyInternalScopeIface interface scope. */
  18. typedef struct
  19. {
  20. sc_boolean e_raised;
  21. sc_integer e_value;
  22. } ConstOnlyInternalScopeIface;
  23. /*! Define dimension of the state configuration vector for orthogonal states. */
  24. #define CONSTONLYINTERNALSCOPE_MAX_ORTHOGONAL_STATES 1
  25. /*!
  26. * Type definition of the data structure for the ConstOnlyInternalScope state machine.
  27. * This data structure has to be allocated by the client code.
  28. */
  29. typedef struct
  30. {
  31. ConstOnlyInternalScopeStates stateConfVector[CONSTONLYINTERNALSCOPE_MAX_ORTHOGONAL_STATES];
  32. sc_ushort stateConfVectorPosition;
  33. ConstOnlyInternalScopeIface iface;
  34. } ConstOnlyInternalScope;
  35. /*! Initializes the ConstOnlyInternalScope state machine data structures. Must be called before first usage.*/
  36. extern void constOnlyInternalScope_init(ConstOnlyInternalScope* handle);
  37. /*! Activates the state machine */
  38. extern void constOnlyInternalScope_enter(ConstOnlyInternalScope* handle);
  39. /*! Deactivates the state machine */
  40. extern void constOnlyInternalScope_exit(ConstOnlyInternalScope* handle);
  41. /*! Performs a 'run to completion' step. */
  42. extern void constOnlyInternalScope_runCycle(ConstOnlyInternalScope* handle);
  43. /*! Raises the in event 'e' that is defined in the default interface scope. */
  44. extern void constOnlyInternalScopeIface_raise_e(ConstOnlyInternalScope* handle, sc_integer value);
  45. /*!
  46. * Checks whether the state machine is active (until 2.4.1 this method was used for states).
  47. * 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.
  48. */
  49. extern sc_boolean constOnlyInternalScope_isActive(const ConstOnlyInternalScope* handle);
  50. /*!
  51. * Checks if all active states are final.
  52. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  53. */
  54. extern sc_boolean constOnlyInternalScope_isFinal(const ConstOnlyInternalScope* handle);
  55. /*! Checks if the specified state is active (until 2.4.1 the used method for states was called isActive()). */
  56. extern sc_boolean constOnlyInternalScope_isStateActive(const ConstOnlyInternalScope* handle, ConstOnlyInternalScopeStates state);
  57. #ifdef __cplusplus
  58. }
  59. #endif
  60. #endif /* CONSTONLYINTERNALSCOPE_H_ */