reactor-c 1.0
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
environment.h File Reference

API for the environment data structure. More...

#include "lf_types.h"
#include "low_level_platform.h"
#include "tracepoint.h"

Go to the source code of this file.

Data Structures

struct  environment_t
 Execution environment. More...
struct  mode_environment_t
 Environment for modal reactors. More...

Macros

#define GLOBAL_ENVIRONMENT   NULL
 The global environment.

Typedefs

typedef struct enclave_info_t enclave_info_t
typedef struct environment_t environment_t
 Execution environment.
typedef struct lf_scheduler_t lf_scheduler_t
typedef struct mode_environment_t mode_environment_t
typedef struct watchdog_t watchdog_t

Functions

int _lf_get_environments (environment_t **envs)
 Update the argument to point to the beginning of the array of environments in this program.
void environment_free (environment_t *env)
 Free the dynamically allocated memory on the environment struct.
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.
void environment_init_tags (environment_t *env, instant_t start_time, interval_t duration)
 Initialize the start and stop tags on the environment struct.
void environment_verify (environment_t *env)
 Verify that the environment is correctly set up.

Detailed Description

API for the environment data structure.

Author
Erling R. Jellum

This is an API for creating and destroying environments. An environment is the "context" within which the reactors are executed. The environment contains data structures which are shared among the reactors such as priority queues, the current logical tag, the worker scheduler, and a lot of meta data. Each reactor stores a pointer to its environment on its self-struct. If a LF program has multiple scheduling enclaves, then each enclave will have its own environment.

Typedef Documentation

◆ enclave_info_t

typedef struct enclave_info_t enclave_info_t

◆ lf_scheduler_t

typedef struct lf_scheduler_t lf_scheduler_t

◆ mode_environment_t

typedef struct mode_environment_t mode_environment_t

◆ watchdog_t

typedef struct watchdog_t watchdog_t