ConstOnlyNamedScope.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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_last_state,
  13. ConstOnlyNamedScope_ConstOnlyNamedScope_main_region_A,
  14. ConstOnlyNamedScope_ConstOnlyNamedScope_main_region_B,
  15. ConstOnlyNamedScope_ConstOnlyNamedScope_main_region_C
  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. /*! Define indices of states in the StateConfVector */
  29. #define SCVI_CONSTONLYNAMEDSCOPE_CONSTONLYNAMEDSCOPE_MAIN_REGION_A 0
  30. #define SCVI_CONSTONLYNAMEDSCOPE_CONSTONLYNAMEDSCOPE_MAIN_REGION_B 0
  31. #define SCVI_CONSTONLYNAMEDSCOPE_CONSTONLYNAMEDSCOPE_MAIN_REGION_C 0
  32. /*!
  33. * Type definition of the data structure for the ConstOnlyNamedScope state machine.
  34. * This data structure has to be allocated by the client code.
  35. */
  36. typedef struct
  37. {
  38. ConstOnlyNamedScopeStates stateConfVector[CONSTONLYNAMEDSCOPE_MAX_ORTHOGONAL_STATES];
  39. sc_ushort stateConfVectorPosition;
  40. ConstOnlyNamedScopeIface iface;
  41. } ConstOnlyNamedScope;
  42. /*! Initializes the ConstOnlyNamedScope state machine data structures. Must be called before first usage.*/
  43. extern void constOnlyNamedScope_init(ConstOnlyNamedScope* handle);
  44. /*! Activates the state machine */
  45. extern void constOnlyNamedScope_enter(ConstOnlyNamedScope* handle);
  46. /*! Deactivates the state machine */
  47. extern void constOnlyNamedScope_exit(ConstOnlyNamedScope* handle);
  48. /*! Performs a 'run to completion' step. */
  49. extern void constOnlyNamedScope_runCycle(ConstOnlyNamedScope* handle);
  50. /*! Raises the in event 'e' that is defined in the default interface scope. */
  51. extern void constOnlyNamedScopeIface_raise_e(ConstOnlyNamedScope* handle, sc_integer value);
  52. /*! Gets the value of the variable 'B' that is defined in the interface scope 'A'. */
  53. extern const sc_integer constOnlyNamedScopeIfaceA_get_b(const ConstOnlyNamedScope* handle);
  54. /*! Gets the value of the variable 'C' that is defined in the interface scope 'A'. */
  55. extern const sc_integer constOnlyNamedScopeIfaceA_get_c(const ConstOnlyNamedScope* handle);
  56. /*!
  57. * Checks whether the state machine is active (until 2.4.1 this method was used for states).
  58. * 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.
  59. */
  60. extern sc_boolean constOnlyNamedScope_isActive(const ConstOnlyNamedScope* handle);
  61. /*!
  62. * Checks if all active states are final.
  63. * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
  64. */
  65. extern sc_boolean constOnlyNamedScope_isFinal(const ConstOnlyNamedScope* handle);
  66. /*! Checks if the specified state is active (until 2.4.1 the used method for states was called isActive()). */
  67. extern sc_boolean constOnlyNamedScope_isStateActive(const ConstOnlyNamedScope* handle, ConstOnlyNamedScopeStates state);
  68. #ifdef __cplusplus
  69. }
  70. #endif
  71. #endif /* CONSTONLYNAMEDSCOPE_H_ */