reactor-c
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
environment.h
Go to the documentation of this file.
1
36#ifndef ENVIRONMENT_H
37#define ENVIRONMENT_H
38
39#include "lf_types.h"
40#include "low_level_platform.h"
41#include "tracepoint.h"
42
43// Forward declarations so that a pointers can appear in the environment struct.
47typedef struct watchdog_t watchdog_t;
48
59#define GLOBAL_ENVIRONMENT NULL
60
115
116#if defined(MODAL_REACTORS)
117struct mode_environment_t {
118 uint8_t triggered_reactions_request;
119 reactor_mode_state_t** modal_reactor_states;
120 int modal_reactor_states_size;
121 mode_state_variable_reset_data_t* state_resets;
122 int state_resets_size;
123};
124#endif
125
129int environment_init(environment_t* env, const char* name, int id, int num_workers, int num_timers,
130 int num_startup_reactions, int num_shutdown_reactions, int num_reset_reactions,
131 int num_is_present_fields, int num_modes, int num_state_resets, int num_watchdogs,
132 const char* trace_file_name);
133
139
144
152
153#endif
struct enclave_info_t enclave_info_t
Definition environment.h:46
struct mode_environment_t mode_environment_t
Definition environment.h:45
struct environment_t environment_t
Execution environment. This struct contains information about the execution environment....
int environment_init(environment_t *env, const char *name, int id, int num_workers, int num_timers, int num_startup_reactions, int num_shutdown_reactions, int num_reset_reactions, int num_is_present_fields, int num_modes, int num_state_resets, int num_watchdogs, const char *trace_file_name)
Initialize an environment struct with parameters given in the arguments.
Definition environment.c:225
int _lf_get_environments(environment_t **envs)
Will update the argument to point to the beginning of the array of environments in this program.
Definition src_gen_stub.c:19
void environment_init_tags(environment_t *env, instant_t start_time, interval_t duration)
Initialize the start and stop tags on the environment struct.
Definition environment.c:213
void environment_free(environment_t *env)
Free the dynamically allocated memory on the environment struct.
Definition environment.c:196
void * lf_thread_t
Definition lf_arduino_support.h:120
void * lf_mutex_t
Definition lf_arduino_support.h:118
Type definitions that are widely used across different parts of the runtime.
int trigger_handle_t
Definition lf_types.h:117
Platform API support for the C target of Lingua Franca.
instant_t start_time
Definition tag.c:33
instant_t duration
Definition reactor_common.c:85
Definition lf_types.h:58
Execution environment. This struct contains information about the execution environment....
Definition environment.h:69
int is_present_fields_abbreviated_size
Definition environment.h:81
lf_mutex_t mutex
Definition environment.h:101
int is_present_fields_size
Definition environment.h:79
_lf_tag_advancement_barrier barrier
Definition environment.h:104
int timer_triggers_size
Definition environment.h:85
lf_cond_t event_q_changed
Definition environment.h:102
int watchdogs_size
Definition environment.h:93
int id
Definition environment.h:73
bool initialized
Definition environment.h:70
int num_workers
Definition environment.h:99
mode_environment_t * modes
Definition environment.h:92
int reset_reactions_size
Definition environment.h:91
char * name
Definition environment.h:72
trigger_t ** timer_triggers
Definition environment.h:84
int worker_thread_count
Definition environment.h:95
reaction_t ** startup_reactions
Definition environment.h:86
tag_t stop_tag
Definition environment.h:75
int startup_reactions_size
Definition environment.h:87
reaction_t ** reset_reactions
Definition environment.h:90
pqueue_tag_t * recycle_q
Definition environment.h:77
bool execution_started
Definition environment.h:71
reaction_t ** shutdown_reactions
Definition environment.h:88
int shutdown_reactions_size
Definition environment.h:89
lf_cond_t global_tag_barrier_requestors_reached_zero
Definition environment.h:105
bool ** is_present_fields
Definition environment.h:78
trigger_handle_t _lf_handle
Definition environment.h:83
watchdog_t ** watchdogs
Definition environment.h:94
tag_t current_tag
Definition environment.h:74
bool ** is_present_fields_abbreviated
Definition environment.h:80
vector_t sparse_io_record_sizes
Definition environment.h:82
lf_scheduler_t * scheduler
Definition environment.h:103
lf_thread_t * thread_ids
Definition environment.h:100
pqueue_tag_t * event_q
Definition environment.h:76
Definition lf_POSIX_threads_support.h:41
Paramters used in schedulers of the threaded reactor C runtime.
Definition scheduler_instance.h:60
Definition pqueue_base.h:73
Definition lf_types.h:155
Definition tag.h:81
Definition lf_types.h:210
Definition vector.h:16
Definition watchdog.h:29
int64_t instant_t
Definition tag.h:66
int64_t interval_t
Definition tag.h:71
Definitions of tracepoint functions for use with the C code generator and any other code generator th...