![]() |
reactor-c 1.0
C Runtime for Lingua Franca
|
API used internally to support modal reactors. More...
Files | |
| file | modes.h |
| Header file of the runtime infrastructure for modes in the C target of Lingua Franca. | |
Data Structures | |
| struct | mode_environment_t |
| Environment for modal reactors. More... | |
| struct | mode_state_variable_reset_data_t |
| A struct to store data for resetting state variables nested in modes. More... | |
| struct | reactor_mode_state_t |
| A struct to store state of the modes in a reactor instance and/or its relation to enclosing modes. More... | |
| struct | reactor_mode_t |
| A struct to represent a single mode instace in a reactor instance. More... | |
Macros | |
| #define | _LF_SET_MODE_WITH_TYPE(mode, change_type) |
| Set the next mode of a modal reactor with an explicit change type (reset or history, from the enum lf_mode_change_type_t). | |
Enumerations | |
| enum | lf_mode_change_type_t { no_transition , reset_transition , history_transition } |
| Type of the mode change. More... | |
Functions | |
| void | _lf_add_suspended_event (event_t *event) |
| Add a suspended event to the list of suspended events. | |
| void | _lf_handle_mode_changes (environment_t *env) |
| Handle the mode changes in the environment. | |
| void | _lf_handle_mode_shutdown_reactions (environment_t *env, reaction_t **shutdown_reactions, int shutdown_reactions_size) |
| Handle the mode shutdown reactions in the environment. | |
| void | _lf_handle_mode_startup_reset_reactions (environment_t *env, reaction_t **startup_reactions, int startup_reactions_size, reaction_t **reset_reactions, int reset_reactions_size, reactor_mode_state_t *states[], int states_size) |
| Handle the mode startup reset reactions in the environment. | |
| void | _lf_handle_mode_triggered_reactions (environment_t *env) |
| Handle the mode triggered reactions in the environment. | |
| void | _lf_initialize_mode_states (environment_t *env, reactor_mode_state_t *states[], int states_size) |
| Initialize the mode states in the environment. | |
| void | _lf_initialize_modes (environment_t *env) |
| Initialize the modes in the environment. | |
| bool | _lf_mode_is_active (reactor_mode_t *mode) |
| Check whether a mode is active. | |
| void | _lf_process_mode_changes (environment_t *env, reactor_mode_state_t *states[], int states_size, mode_state_variable_reset_data_t reset_data[], int reset_data_size, trigger_t *timer_triggers[], int timer_triggers_size) |
| Process the mode changes in the environment. | |
| void | _lf_terminate_modal_reactors (environment_t *env) |
| Terminate the modal reactors in the environment. | |
API used internally to support modal reactors.
These functions and types are not meant to be used directly by users, but are useful for developers.
| #define _LF_SET_MODE_WITH_TYPE | ( | mode, | |
| change_type ) |
#include </Users/runner/work/reactor-c/reactor-c/include/core/modal_models/modes.h>
Set the next mode of a modal reactor with an explicit change type (reset or history, from the enum lf_mode_change_type_t).
This macro is not meant to be used by LF programmers. It is used in Python.
| mode | The target mode to set for activation. |
| change_type | The change type of the transition. |
#include </Users/runner/work/reactor-c/reactor-c/include/core/modal_models/modes.h>
Type of the mode change.
| Enumerator | |
|---|---|
| no_transition | |
| reset_transition | |
| history_transition | |
| void _lf_add_suspended_event | ( | event_t * | event | ) |
#include </Users/runner/work/reactor-c/reactor-c/include/core/modal_models/modes.h>
Add a suspended event to the list of suspended events.
| event | The event to add. |
| void _lf_handle_mode_changes | ( | environment_t * | env | ) |
#include </Users/runner/work/reactor-c/reactor-c/include/core/modal_models/modes.h>
Handle the mode changes in the environment.
| env | The environment to handle the mode changes in. |
| void _lf_handle_mode_shutdown_reactions | ( | environment_t * | env, |
| reaction_t ** | shutdown_reactions, | ||
| int | shutdown_reactions_size ) |
#include </Users/runner/work/reactor-c/reactor-c/include/core/modal_models/modes.h>
Handle the mode shutdown reactions in the environment.
| env | The environment to handle the mode shutdown reactions in. |
| shutdown_reactions | The array of shutdown reactions to handle. |
| shutdown_reactions_size | The size of the shutdown reactions array. |
| void _lf_handle_mode_startup_reset_reactions | ( | environment_t * | env, |
| reaction_t ** | startup_reactions, | ||
| int | startup_reactions_size, | ||
| reaction_t ** | reset_reactions, | ||
| int | reset_reactions_size, | ||
| reactor_mode_state_t * | states[], | ||
| int | states_size ) |
#include </Users/runner/work/reactor-c/reactor-c/include/core/modal_models/modes.h>
Handle the mode startup reset reactions in the environment.
| env | The environment to handle the mode startup reset reactions in. |
| startup_reactions | The array of startup reactions to handle. |
| startup_reactions_size | The size of the startup reactions array. |
| reset_reactions | The array of reset reactions to handle. |
| reset_reactions_size | The size of the reset reactions array. |
| states | The array of mode states to handle. |
| states_size | The size of the states array. |
| void _lf_handle_mode_triggered_reactions | ( | environment_t * | env | ) |
#include </Users/runner/work/reactor-c/reactor-c/include/core/modal_models/modes.h>
Handle the mode triggered reactions in the environment.
| env | The environment to handle the mode triggered reactions in. |
| void _lf_initialize_mode_states | ( | environment_t * | env, |
| reactor_mode_state_t * | states[], | ||
| int | states_size ) |
#include </Users/runner/work/reactor-c/reactor-c/include/core/modal_models/modes.h>
Initialize the mode states in the environment.
| env | The environment to initialize the mode states in. |
| states | The array of mode states to initialize. |
| states_size | The size of the states array. |
| void _lf_initialize_modes | ( | environment_t * | env | ) |
#include </Users/runner/work/reactor-c/reactor-c/include/core/modal_models/modes.h>
Initialize the modes in the environment.
| env | The environment to initialize the modes in. |
| bool _lf_mode_is_active | ( | reactor_mode_t * | mode | ) |
#include </Users/runner/work/reactor-c/reactor-c/include/core/modal_models/modes.h>
Check whether a mode is active.
| mode | The mode to check. |
| void _lf_process_mode_changes | ( | environment_t * | env, |
| reactor_mode_state_t * | states[], | ||
| int | states_size, | ||
| mode_state_variable_reset_data_t | reset_data[], | ||
| int | reset_data_size, | ||
| trigger_t * | timer_triggers[], | ||
| int | timer_triggers_size ) |
#include </Users/runner/work/reactor-c/reactor-c/include/core/modal_models/modes.h>
Process the mode changes in the environment.
| env | The environment to process the mode changes in. |
| states | The array of mode states to process. |
| states_size | The size of the states array. |
| reset_data | The array of reset data to process. |
| reset_data_size | The size of the reset data array. |
| timer_triggers | The array of timer triggers to process. |
| timer_triggers_size | The size of the timer triggers array. |
| void _lf_terminate_modal_reactors | ( | environment_t * | env | ) |
#include </Users/runner/work/reactor-c/reactor-c/include/core/modal_models/modes.h>
Terminate the modal reactors in the environment.
| env | The environment to terminate the modal reactors in. |