reactor-c
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
environment.h
Go to the documentation of this file.
1
16#ifndef ENVIRONMENT_H
17#define ENVIRONMENT_H
18
19#include "lf_types.h"
20#include "low_level_platform.h"
21#include "tracepoint.h"
22
23// Forward declarations so that a pointers can appear in the environment struct.
27typedef struct watchdog_t watchdog_t;
28
39#define GLOBAL_ENVIRONMENT NULL
40
95
96#if defined(MODAL_REACTORS)
97struct mode_environment_t {
98 uint8_t triggered_reactions_request;
99 reactor_mode_state_t** modal_reactor_states;
100 int modal_reactor_states_size;
101 mode_state_variable_reset_data_t* state_resets;
102 int state_resets_size;
103};
104#endif
105
109int environment_init(environment_t* env, const char* name, int id, int num_workers, int num_timers,
110 int num_startup_reactions, int num_shutdown_reactions, int num_reset_reactions,
111 int num_is_present_fields, int num_modes, int num_state_resets, int num_watchdogs,
112 const char* trace_file_name);
113
119
124
132
133#endif
struct enclave_info_t enclave_info_t
Definition environment.h:26
struct mode_environment_t mode_environment_t
Definition environment.h:25
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:204
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:192
void environment_free(environment_t *env)
Free the dynamically allocated memory on the environment struct.
Definition environment.c:175
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:49
int is_present_fields_abbreviated_size
Definition environment.h:61
lf_mutex_t mutex
Definition environment.h:81
int is_present_fields_size
Definition environment.h:59
_lf_tag_advancement_barrier barrier
Definition environment.h:84
int timer_triggers_size
Definition environment.h:65
lf_cond_t event_q_changed
Definition environment.h:82
int watchdogs_size
Definition environment.h:73
int id
Definition environment.h:53
bool initialized
Definition environment.h:50
int num_workers
Definition environment.h:79
mode_environment_t * modes
Definition environment.h:72
int reset_reactions_size
Definition environment.h:71
char * name
Definition environment.h:52
trigger_t ** timer_triggers
Definition environment.h:64
int worker_thread_count
Definition environment.h:75
reaction_t ** startup_reactions
Definition environment.h:66
tag_t stop_tag
Definition environment.h:55
int startup_reactions_size
Definition environment.h:67
reaction_t ** reset_reactions
Definition environment.h:70
pqueue_tag_t * recycle_q
Definition environment.h:57
bool execution_started
Definition environment.h:51
reaction_t ** shutdown_reactions
Definition environment.h:68
int shutdown_reactions_size
Definition environment.h:69
lf_cond_t global_tag_barrier_requestors_reached_zero
Definition environment.h:85
bool ** is_present_fields
Definition environment.h:58
trigger_handle_t _lf_handle
Definition environment.h:63
watchdog_t ** watchdogs
Definition environment.h:74
tag_t current_tag
Definition environment.h:54
bool ** is_present_fields_abbreviated
Definition environment.h:60
vector_t sparse_io_record_sizes
Definition environment.h:62
lf_scheduler_t * scheduler
Definition environment.h:83
lf_thread_t * thread_ids
Definition environment.h:80
pqueue_tag_t * event_q
Definition environment.h:56
Definition lf_POSIX_threads_support.h:41
Paramters used in schedulers of the threaded reactor C runtime.
Definition scheduler_instance.h:34
Definition pqueue_base.h:73
Definition lf_types.h:155
Definition tag.h:81
Definition lf_types.h:208
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...