ConstOnlyDefaultScope.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #ifndef CONSTONLYDEFAULTSCOPE_H_
  2. #define CONSTONLYDEFAULTSCOPE_H_
  3. #include "sc_types.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*! \file Header of the state machine 'ConstOnlyDefaultScope'.
  8. */
  9. /*! Enumeration of all states */
  10. typedef enum
  11. {
  12. ConstOnlyDefaultScope_last_state,
  13. ConstOnlyDefaultScope_ConstOnlyDefaultScope_main_region_A,
  14. ConstOnlyDefaultScope_ConstOnlyDefaultScope_main_region_B,
  15. ConstOnlyDefaultScope_ConstOnlyDefaultScope_main_region_C
  16. } ConstOnlyDefaultScopeStates;
  17. /* Declaration of constants for scope ConstOnlyDefaultScopeIface. */
  18. extern const sc_integer CONSTONLYDEFAULTSCOPE_CONSTONLYDEFAULTSCOPEIFACE_B;
  19. extern const sc_integer CONSTONLYDEFAULTSCOPE_CONSTONLYDEFAULTSCOPEIFACE_C;
  20. /*! Type definition of the data structure for the ConstOnlyDefaultScopeIfaceA interface scope. */
  21. typedef struct
  22. {
  23. sc_boolean e_raised;
  24. sc_integer e_value;
  25. } ConstOnlyDefaultScopeIfaceA;
  26. /*! Define dimension of the state configuration vector for orthogonal states. */
  27. #define CONSTONLYDEFAULTSCOPE_MAX_ORTHOGONAL_STATES 1
  28. /*! Define indices of states in the StateConfVector */
  29. #define SCVI_CONSTONLYDEFAULTSCOPE_CONSTONLYDEFAULTSCOPE_MAIN_REGION_A 0
  30. #define SCVI_CONSTONLYDEFAULTSCOPE_CONSTONLYDEFAULTSCOPE_MAIN_REGION_B 0
  31. #define SCVI_CONSTONLYDEFAULTSCOPE_CONSTONLYDEFAULTSCOPE_MAIN_REGION_C 0
  32. /*!
  33. * Type definition of the data structure for the ConstOnlyDefaultScope state machine.
  34. * This data structure has to be allocated by the client code.
  35. */
  36. typedef struct
  37. {
  38. ConstOnlyDefaultScopeStates stateConfVector[CONSTONLYDEFAULTSCOPE_MAX_ORTHOGONAL_STATES];
  39. sc_ushort stateConfVectorPosition;
  40. ConstOnlyDefaultScopeIfaceA ifaceA;
  41. } ConstOnlyDefaultScope;
  42. /*! Initializes the ConstOnlyDefaultScope state machine data structures. Must be called before first usage.*/
  43. extern void constOnlyDefaultScope_init(ConstOnlyDefaultScope* handle);
  44. /*! Activates the state machine */
  45. extern void constOnlyDefaultScope_enter(ConstOnlyDefaultScope* handle);
  46. /*! Deactivates the state machine */
  47. extern void constOnlyDefaultScope_exit(ConstOnlyDefaultScope* handle);
  48. /*! Performs a 'run to completion' step. */
  49. extern void constOnlyDefaultScope_runCycle(ConstOnlyDefaultScope* handle);
  50. /*! Gets the value of the variable 'B' that is defined in the default interface scope. */
  51. extern const sc_integer constOnlyDefaultScopeIface_get_b(const ConstOnlyDefaultScope* handle);
  52. /*! Gets the value of the variable 'C' that is defined in the default interface scope. */
  53. extern const sc_integer constOnlyDefaultScopeIface_get_c(const ConstOnlyDefaultScope* handle);
  54. /*! Raises the in event 'e' that is defined in the interface scope 'A'. */
  55. extern void constOnlyDefaultScopeIfaceA_raise_e(ConstOnlyDefaultScope* handle, sc_integer value);
  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 constOnlyDefaultScope_isActive(const ConstOnlyDefaultScope* 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 constOnlyDefaultScope_isFinal(const ConstOnlyDefaultScope* 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 constOnlyDefaultScope_isStateActive(const ConstOnlyDefaultScope* handle, ConstOnlyDefaultScopeStates state);
  68. #ifdef __cplusplus
  69. }
  70. #endif
  71. #endif /* CONSTONLYDEFAULTSCOPE_H_ */