51#define SCHED_ADAPTIVE 1
57#define SCHED_GEDF_NP 2
159#warning "string typedef has been previously given."
556#if !defined(LF_SINGLE_THREADED)
565#if defined(MODAL_REACTORS)
char * string
String type so that we don't have to use {= char* =}.
Definition lf_types.h:157
int64_t instant_t
Time instant.
Definition tag.h:101
int64_t interval_t
Interval of time.
Definition tag.h:107
lf_spacing_policy_t
Policy for handling scheduled events that violate the specified minimum interarrival time.
Definition lf_types.h:105
void(* reaction_function_t)(void *)
Reaction function type.
Definition lf_types.h:176
int trigger_handle_t
Handles for scheduled triggers.
Definition lf_types.h:146
unsigned short int ushort
Unsigned short type.
Definition lf_types.h:36
pqueue_pri_t index_t
Topological order index for reactions.
Definition lf_types.h:166
reaction_status_t
Status of a given reaction at a given logical time.
Definition lf_types.h:135
port_status_t
Status of a given port at a given logical time.
Definition lf_types.h:120
unsigned long long pqueue_pri_t
Priority data type.
Definition pqueue_base.h:61
@ update
Definition lf_types.h:105
@ drop
Definition lf_types.h:105
@ defer
Definition lf_types.h:105
@ replace
Definition lf_types.h:105
@ inactive
Definition lf_types.h:135
@ queued
Definition lf_types.h:135
@ running
Definition lf_types.h:135
@ absent
Definition lf_types.h:120
@ unknown
Definition lf_types.h:120
@ present
Definition lf_types.h:120
Definitions for token objects, reference-counted wrappers around dynamically-allocated messages.
Header file of the runtime infrastructure for modes in the C target of Lingua Franca.
Priority queue definitions for queues where the priority is a number that can be compared with ordina...
Priority queue that uses tags for sorting.
Allocation record to keep track of dynamically-allocated memory.
Definition lf_types.h:499
struct allocation_record_t * next
Definition lf_types.h:501
void * allocated
Definition lf_types.h:500
Execution environment.
Definition environment.h:52
Event activation record to push onto the event queue.
Definition lf_types.h:354
trigger_t * trigger
Pointer to the associated trigger.
Definition lf_types.h:367
tag_t intended_tag
The intended tag for this event.
Definition lf_types.h:383
pqueue_tag_element_t base
Base priority queue element containing tag and position.
Definition lf_types.h:360
lf_token_t * token
Pointer to the token wrapping the event's value.
Definition lf_types.h:374
Base type for actions.
Definition lf_types.h:583
token_template_t tmplt
Type and token information template.
Definition lf_types.h:590
bool is_present
Flag indicating whether the action has a value at the current logical time.
Definition lf_types.h:596
bool has_value
Flag indicating whether the action has a value.
Definition lf_types.h:616
trigger_t * trigger
Pointer to the trigger associated with this action.
Definition lf_types.h:603
self_base_t * parent
Pointer to the parent reactor's self struct.
Definition lf_types.h:609
int source_id
Source identifier for federated network input actions.
Definition lf_types.h:623
Internal part of the action structs.
Definition lf_types.h:629
trigger_t * trigger
Definition lf_types.h:630
Internal part of the port structs.
Definition lf_types.h:638
self_base_t * source_reactor
Definition lf_types.h:642
int num_destinations
Definition lf_types.h:641
int destination_channel
Definition lf_types.h:640
lf_sparse_io_record_t * sparse_record
Definition lf_types.h:639
A record of the subset of channels of a multiport that have present inputs.
Definition lf_token.h:120
A struct representing a barrier in threaded LF programs.
Definition lf_types.h:72
int requestors
Number of requestors waiting at the barrier.
Definition lf_types.h:78
tag_t horizon
Tag horizon for barrier advancement.
Definition lf_types.h:86
Token type for dynamically allocated arrays and structs sent as messages.
Definition lf_token.h:99
The type for an element in a priority queue that is sorted by tag.
Definition pqueue_tag.h:53
Reaction activation record to push onto the reaction queue.
Definition lf_types.h:195
bool ** output_produced
Array of pointers to booleans indicating output production.
Definition lf_types.h:251
bool is_STP_violated
Flag indicating STP violation in input triggers.
Definition lf_types.h:290
reaction_status_t status
Current status of the reaction.
Definition lf_types.h:274
reaction_function_t deadline_violation_handler
Function to handle deadline violations.
Definition lf_types.h:297
void * self
Pointer to the reactor's state struct.
Definition lf_types.h:208
const char * name
Full name of the reaction for logging purposes.
Definition lf_types.h:330
index_t index
Inverse priority determined by dependency analysis.
Definition lf_types.h:222
trigger_t *** triggers
Array of trigger arrays for each output.
Definition lf_types.h:266
reaction_function_t STP_handler
Function to handle STP violations.
Definition lf_types.h:306
size_t worker_affinity
Worker thread affinity suggestion.
Definition lf_types.h:322
int * triggered_sizes
Array of trigger counts per output.
Definition lf_types.h:258
interval_t deadline
Deadline relative to the reaction's invocation time.
Definition lf_types.h:281
size_t pos
Current position in the priority queue.
Definition lf_types.h:229
bool is_an_input_reaction
Flag indicating if this is a network input reaction.
Definition lf_types.h:314
int number
The reaction number within its reactor.
Definition lf_types.h:215
size_t num_outputs
Number of outputs that may be produced by this reaction.
Definition lf_types.h:244
reaction_t * last_enabling_reaction
Pointer to the last enabling reaction.
Definition lf_types.h:237
reactor_mode_t * mode
Pointer to the enclosing mode of this reaction.
Definition lf_types.h:338
reaction_function_t function
The reaction function to be executed.
Definition lf_types.h:201
A struct to store state of the modes in a reactor instance and/or its relation to enclosing modes.
Definition modes.h:109
A struct to represent a single mode instace in a reactor instance.
Definition modes.h:78
The base type for all reactor self structs.
Definition lf_types.h:519
struct reaction_t * executing_reaction
Pointer to the currently executing reaction of the reactor.
Definition lf_types.h:530
char * name
The name of the reactor instance.
Definition lf_types.h:542
environment_t * environment
Pointer to the environment in which the reactor is executing.
Definition lf_types.h:536
reactor_mode_state_t _lf__mode_state
The current mode state for modal models.
Definition lf_types.h:570
struct allocation_record_t * allocations
Pointer to the head of a NULL-terminated linked list of allocation records.
Definition lf_types.h:524
char * full_name
The full hierarchical name of the reactor.
Definition lf_types.h:548
self_base_t * parent
Pointer to the parent reactor of this reactor instance.
Definition lf_types.h:554
void * reactor_mutex
Mutex used to protect the reactor from concurrent access.
Definition lf_types.h:562
A tag is a time, microstep pair.
Definition tag.h:119
Base type for ports (lf_port_base_t) and actions (trigger_t), which can carry tokens.
Definition lf_token.h:156
Trigger struct representing an output, timer, action, or input.
Definition lf_types.h:391
tag_t intended_tag
The intended trigger time of this trigger.
Definition lf_types.h:477
interval_t period
Minimum interarrival time for an action trigger.
Definition lf_types.h:427
reaction_t ** reactions
Array of pointers to reactions that are sensitive to this trigger.
Definition lf_types.h:403
tag_t last_known_status_tag
Last known status tag of the port.
Definition lf_types.h:469
int number_of_reactions
Number of reactions that are sensitive to this trigger.
Definition lf_types.h:409
tag_t last_tag
Tag of the last event scheduled for this action.
Definition lf_types.h:439
bool is_timer
Flag indicating whether this trigger is a timer.
Definition lf_types.h:415
token_template_t tmplt
Type and token information template.
Definition lf_types.h:397
reactor_mode_t * mode
Pointer to the enclosing mode of this trigger.
Definition lf_types.h:461
lf_spacing_policy_t policy
Policy for handling events scheduled too early.
Definition lf_types.h:446
port_status_t status
Current status of the port at the current logical time.
Definition lf_types.h:454
bool is_physical
Flag indicating whether this trigger represents a physical action.
Definition lf_types.h:433
instant_t physical_time_of_arrival
Physical time at which the message was received on the network.
Definition lf_types.h:485
interval_t offset
Minimum delay for an action trigger.
Definition lf_types.h:421
Time and tag definitions and functions for Lingua Franca.