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

Declarations of functions with implementations in reactor.c and reactor_threaded.c. More...

#include "lf_types.h"
#include "environment.h"
#include "tag.h"
#include "pqueue.h"
#include "vector.h"
#include "util.h"
#include "modes.h"
#include "port.h"

Go to the source code of this file.

Macros

#define MIN_SLEEP_DURATION   USEC(10)
 Constant giving the minimum amount of time to sleep to wait for physical time to reach a logical time.

Functions

void _lf_advance_tag (environment_t *env, tag_t next_tag)
 Advance from the current tag to the next.
event_t_lf_create_dummy_events (environment_t *env, tag_t tag)
 Create a dummy event with the specified tag.
bool _lf_initialize_timer (environment_t *env, trigger_t *timer)
 Initialize the given timer.
bool _lf_initialize_timers (environment_t *env)
 Initialize all the timers in the environment.
void _lf_initialize_trigger_objects ()
 Generated function that produces a table containing all triggers (i.e., inputs, timers, and actions).
trigger_handle_t _lf_insert_reactions_for_trigger (environment_t *env, trigger_t *trigger, lf_token_t *token)
 Insert reactions triggered by trigger to the reaction queue.
void _lf_invoke_reaction (environment_t *env, reaction_t *reaction, int worker)
 Invoke the specified reaction on the specified worker in the specified environment.
void _lf_pop_events (environment_t *env)
 Pop all events from event_q with tag equal to current tag.
trigger_handle_t _lf_schedule_at_tag (environment_t *env, trigger_t *trigger, tag_t tag, lf_token_t *token)
 Schedule an event at a specific tag (time, microstep).
trigger_handle_t _lf_schedule_copy (environment_t *env, void *action, interval_t offset, void *value, size_t length)
 Schedule an action to occur with the specified value and time offset with a copy of the specified value.
trigger_handle_t _lf_schedule_token (environment_t *env, void *action, interval_t extra_delay, lf_token_t *token)
 Schedule the specified action at a later tag with the specified token as a payload.
void _lf_start_time_step (environment_t *env)
 Perform whatever is needed to start a time step.
void _lf_trigger_reaction (environment_t *env, reaction_t *reaction, int worker_number)
 Trigger the specified reaction on the specified worker in the specified environment.
void _lf_trigger_shutdown_reactions (environment_t *env)
 Trigger all the shutdown reactions in the specified environment.
void _lf_trigger_startup_reactions (environment_t *env)
 Trigger all the startup reactions in the specified environment.
void initialize_global ()
 Initialize global variables and start tracing before calling the _lf_initialize_trigger_objects() function.
index_t lf_combine_deadline_and_level (interval_t deadline, int level)
 Combine a deadline and a level into a single index for sorting in the reaction queue.
void lf_create_environments (void)
 Create and initialize the required number of environments for the program.
void lf_free (struct allocation_record_t **head)
 Free memory on the specified allocation record (a self struct).
event_tlf_get_new_event (environment_t *env)
 Get a new event.
void lf_recycle_event (environment_t *env, event_t *e)
 Recycle the given event.
void lf_replace_token (event_t *event, lf_token_t *token)
 Replace the token on the specified event with the specified token and free the old token.
void lf_set_default_command_line_options (void)
 Generated function that optionally sets default command-line options.
void lf_terminate_execution (environment_t *env)
 Function that is called when the program is about to exit.
int process_args (int argc, const char *argv[])
 Process the command-line arguments.
void schedule_output_reactions (environment_t *env, reaction_t *reaction, int worker)
 Schedule the output reactions for the specified reaction in the specified environment.
void termination (void)
 Perform final wrap-up on exit.

Variables

bool _lf_normal_termination
unsigned int _lf_number_of_workers
struct allocation_record_t_lf_reactors_to_free
int default_argc
const char ** default_argv
instant_t duration
bool fast
bool keepalive_specified
interval_t lf_fed_STA_offset

Detailed Description

Declarations of functions with implementations in reactor.c and reactor_threaded.c.

Author
Edward A. Lee
Marten Lohstroh
Soroush Bateni
Mehrdad Niknami
Alexander Schulz-Rosengarten
Erling Rennemo Jellum

The functions declared in this file, as opposed to the ones in reactor.h, are not meant to be called by application programmers. They should be viewed as private functions that make up the C runtime. In some cases, the implementation of these functions is in reactor_common.c, and in other cases, alternative implementations are provided in reactor.c and reactor_threaded.c. A third possibility is that the function is code generated.

Variable Documentation

◆ _lf_normal_termination

bool _lf_normal_termination
extern

◆ _lf_number_of_workers

unsigned int _lf_number_of_workers
extern

◆ _lf_reactors_to_free

struct allocation_record_t* _lf_reactors_to_free
extern

◆ default_argc

int default_argc
extern

◆ default_argv

const char** default_argv
extern

◆ duration

instant_t duration
extern

◆ fast

bool fast
extern

◆ keepalive_specified

bool keepalive_specified
extern

◆ lf_fed_STA_offset

interval_t lf_fed_STA_offset
extern