ConstOnlyNamedScope.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #ifndef CONSTONLYNAMEDSCOPE_H_
  2. #define CONSTONLYNAMEDSCOPE_H_
  3. #include "sc_types.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*! \file Header of the state machine 'ConstOnlyNamedScope'.
  8. */
  9. /*! Enumeration of all states */
  10. typedef enum
  11. {
  12. ConstOnlyNamedScope_ConstOnlyNamedScope_main_region_A,
  13. ConstOnlyNamedScope_ConstOnlyNamedScope_main_region_B,
  14. ConstOnlyNamedScope_ConstOnlyNamedScope_main_region_C,
  15. ConstOnlyNamedScope_last_state
  16. } ConstOnlyNamedScopeStates;
  17. /*! Type definition of the data structure for the ConstOnlyNamedScopeIface interface scope. */
  18. typedef struct
  19. {
  20. sc_boolean e_raised;
  21. sc_integer e_value;
  22. } ConstOnlyNamedScopeIface;
  23. /* Declaration of constants for scope ConstOnlyNamedScopeIfaceA. */
  24. extern const sc_integer CONSTONLYNAMEDSCOPE_CONSTONLYNAMEDSCOPEIFACEA_B;
  25. extern const sc_integer CONSTONLYNAMEDSCOPE_CONSTONLYNAMEDSCOPEIFACEA_C;
  26. /*! Define dimension of the state configuration vector for orthogonal states. */
  27. #define CONSTONLYNAMEDSCOPE_MAX_ORTHOGONAL_STATES 1
  28. /*!
  29. * Type definition of the data structure for the ConstOnlyNamedScope state machine.
  30. * This data structure has to be allocated by the client code.
  31. */
  32. typedef struct
  33. {
  34. ConstOnlyNamedScopeStates stateConfVector[CONSTONLYNAMEDSCOPE_MAX_ORTHOGONAL_STATES];
  35. sc_ushort stateConfVectorPosition;
  36. ConstOnlyNamedScopeIface iface;
  37. } ConstOnlyNamedScope;
  38. /*! Initializes the ConstOnlyNamedScope state machine data structures. Must be called before first usage.*/
  39. extern void constOnlyNamedScope_init(ConstOnlyNamedScope* handle);
  40. /*! Activates the state machine */
  41. extern void constOnlyNamedScope_enter(ConstOnlyNamedScope* handle);
  42. /*! Deactivates the state machine */
  43. extern void constOnlyNamedScope_exit(ConstOnlyNamedScope* handle);
  44. /*! Performs a 'run to completion' step. */
  45. extern void constOnlyNamedScope_runCycle(ConstOnlyNamedScope* handle);
  46. /*! Raises the in event 'e' that is defined in the default interface scope. */
  47. extern void constOnlyNamedScopeIface_raise_e(ConstOnlyNamedScope* handle, sc_integer value);
  48. /*! Gets the value of the variable 'B' that is defined in the interface scope 'A'. */
  49. extern const sc_integer constOnlyNamedScopeIfaceA_get_b(const ConstOnlyNamedScope* handle);
  50. /*! Gets the value of the variable 'C' that is defined in the interface scope 'A'. */
  51. extern const sc_integer constOnlyNamedScopeIfaceA_get_c(const ConstOnlyNamedScope* handle);
  52. /*!
  53. * Checks whether the state machine is active (until 2.4.1 this method was used for states).
  54. * 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.
  55. */
  56. extern sc_boolean constOnlyNamedScope_isActive(const ConstOnlyNamedScope* handle);
  57. /*!
  58. * Checks if all active states are final.
  59. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  60. */
  61. extern sc_boolean constOnlyNamedScope_isFinal(const ConstOnlyNamedScope* handle);
  62. /*! Checks if the specified state is active (until 2.4.1 the used method for states was called isActive()). */
  63. extern sc_boolean constOnlyNamedScope_isStateActive(const ConstOnlyNamedScope* handle, ConstOnlyNamedScopeStates state);
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67. #endif /* CONSTONLYNAMEDSCOPE_H_ */