ConstOnlyInternalScope.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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_last_state,
  13. ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_A,
  14. ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_B,
  15. ConstOnlyInternalScope_ConstOnlyInternalScope_main_region_C
  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. /*! Define indices of states in the StateConfVector */
  26. #define SCVI_CONSTONLYINTERNALSCOPE_CONSTONLYINTERNALSCOPE_MAIN_REGION_A 0
  27. #define SCVI_CONSTONLYINTERNALSCOPE_CONSTONLYINTERNALSCOPE_MAIN_REGION_B 0
  28. #define SCVI_CONSTONLYINTERNALSCOPE_CONSTONLYINTERNALSCOPE_MAIN_REGION_C 0
  29. /*!
  30. * Type definition of the data structure for the ConstOnlyInternalScope state machine.
  31. * This data structure has to be allocated by the client code.
  32. */
  33. typedef struct
  34. {
  35. ConstOnlyInternalScopeStates stateConfVector[CONSTONLYINTERNALSCOPE_MAX_ORTHOGONAL_STATES];
  36. sc_ushort stateConfVectorPosition;
  37. ConstOnlyInternalScopeIface iface;
  38. } ConstOnlyInternalScope;
  39. /*! Initializes the ConstOnlyInternalScope state machine data structures. Must be called before first usage.*/
  40. extern void constOnlyInternalScope_init(ConstOnlyInternalScope* handle);
  41. /*! Activates the state machine */
  42. extern void constOnlyInternalScope_enter(ConstOnlyInternalScope* handle);
  43. /*! Deactivates the state machine */
  44. extern void constOnlyInternalScope_exit(ConstOnlyInternalScope* handle);
  45. /*! Performs a 'run to completion' step. */
  46. extern void constOnlyInternalScope_runCycle(ConstOnlyInternalScope* handle);
  47. /*! Raises the in event 'e' that is defined in the default interface scope. */
  48. extern void constOnlyInternalScopeIface_raise_e(ConstOnlyInternalScope* handle, sc_integer value);
  49. /*!
  50. * Checks whether the state machine is active (until 2.4.1 this method was used for states).
  51. * 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.
  52. */
  53. extern sc_boolean constOnlyInternalScope_isActive(const ConstOnlyInternalScope* handle);
  54. /*!
  55. * Checks if all active states are final.
  56. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  57. */
  58. extern sc_boolean constOnlyInternalScope_isFinal(const ConstOnlyInternalScope* handle);
  59. /*! Checks if the specified state is active (until 2.4.1 the used method for states was called isActive()). */
  60. extern sc_boolean constOnlyInternalScope_isStateActive(const ConstOnlyInternalScope* handle, ConstOnlyInternalScopeStates state);
  61. #ifdef __cplusplus
  62. }
  63. #endif
  64. #endif /* CONSTONLYINTERNALSCOPE_H_ */