1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #ifndef STATECHARTLOCALREACTIONS_H_
- #define STATECHARTLOCALREACTIONS_H_
- #include "sc_types.h"
-
- #ifdef __cplusplus
- extern "C" {
- #endif
- /*! \file Header of the state machine 'StatechartLocalReactions'.
- */
- /*! Enumeration of all states */
- typedef enum
- {
- StatechartLocalReactions_main_region_S1,
- StatechartLocalReactions_main_region_S2,
- StatechartLocalReactions_region2_a,
- StatechartLocalReactions_last_state
- } StatechartLocalReactionsStates;
- /*! Type definition of the data structure for the StatechartLocalReactionsIface interface scope. */
- typedef struct
- {
- sc_integer myInt;
- } StatechartLocalReactionsIface;
- /*! Define dimension of the state configuration vector for orthogonal states. */
- #define STATECHARTLOCALREACTIONS_MAX_ORTHOGONAL_STATES 2
- /*!
- * Type definition of the data structure for the StatechartLocalReactions state machine.
- * This data structure has to be allocated by the client code.
- */
- typedef struct
- {
- StatechartLocalReactionsStates stateConfVector[STATECHARTLOCALREACTIONS_MAX_ORTHOGONAL_STATES];
- sc_ushort stateConfVectorPosition;
-
- StatechartLocalReactionsIface iface;
- } StatechartLocalReactions;
- /*! Initializes the StatechartLocalReactions state machine data structures. Must be called before first usage.*/
- extern void statechartLocalReactions_init(StatechartLocalReactions* handle);
- /*! Activates the state machine */
- extern void statechartLocalReactions_enter(StatechartLocalReactions* handle);
- /*! Deactivates the state machine */
- extern void statechartLocalReactions_exit(StatechartLocalReactions* handle);
- /*! Performs a 'run to completion' step. */
- extern void statechartLocalReactions_runCycle(StatechartLocalReactions* handle);
- /*! Gets the value of the variable 'myInt' that is defined in the default interface scope. */
- extern sc_integer statechartLocalReactionsIface_get_myInt(const StatechartLocalReactions* handle);
- /*! Sets the value of the variable 'myInt' that is defined in the default interface scope. */
- extern void statechartLocalReactionsIface_set_myInt(StatechartLocalReactions* handle, sc_integer value);
- /*!
- * Checks whether the state machine is active (until 2.4.1 this method was used for states).
- * 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.
- */
- extern sc_boolean statechartLocalReactions_isActive(const StatechartLocalReactions* handle);
- /*!
- * Checks if all active states are final.
- * If there are no active states then the state machine is considered being inactive. In this case this method returns false.
- */
- extern sc_boolean statechartLocalReactions_isFinal(const StatechartLocalReactions* handle);
- /*! Checks if the specified state is active (until 2.4.1 the used method for states was called isActive()). */
- extern sc_boolean statechartLocalReactions_isStateActive(const StatechartLocalReactions* handle, StatechartLocalReactionsStates state);
- #ifdef __cplusplus
- }
- #endif
- #endif /* STATECHARTLOCALREACTIONS_H_ */
|