reactor-c 1.0
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
self_base_t Struct Reference

The base type for all reactor self structs. More...

#include <lf_types.h>

Data Fields

reactor_mode_state_t _lf__mode_state
 The current mode state for modal models.
struct allocation_record_tallocations
 Pointer to the head of a NULL-terminated linked list of allocation records.
environment_tenvironment
 Pointer to the environment in which the reactor is executing.
struct reaction_texecuting_reaction
 Pointer to the currently executing reaction of the reactor.
char * full_name
 The full hierarchical name of the reactor.
char * name
 The name of the reactor instance.
self_base_tparent
 Pointer to the parent reactor of this reactor instance.
void * reactor_mutex
 Mutex used to protect the reactor from concurrent access.

Detailed Description

The base type for all reactor self structs.

The first element of every self struct defined in generated code will be a pointer to an allocation record, which is either NULL or the head of a NULL-terminated linked list of allocation records. This list is used to free memory that has been dynamically allocated. This struct also provides a pointer to the currently executing reaction, to the environment in which the reaction is executing, and to the mutex that is used to protect the reactor. If modal models are being used, it also records the current mode.

Field Documentation

◆ _lf__mode_state

reactor_mode_state_t self_base_t::_lf__mode_state

The current mode state for modal models.

Only present when modal reactors are enabled.

◆ allocations

struct allocation_record_t* self_base_t::allocations

Pointer to the head of a NULL-terminated linked list of allocation records.

Used to track and free dynamically allocated memory for this reactor instance.

◆ environment

environment_t* self_base_t::environment

Pointer to the environment in which the reactor is executing.

Contains runtime context and configuration for the reactor.

◆ executing_reaction

struct reaction_t* self_base_t::executing_reaction

Pointer to the currently executing reaction of the reactor.

This field is updated during reaction execution to track which reaction is running.

◆ full_name

char* self_base_t::full_name

The full hierarchical name of the reactor.

This will be NULL unless lf_reactor_full_name() is called.

◆ name

char* self_base_t::name

The name of the reactor instance.

For bank reactors, this will be appended with [index].

◆ parent

self_base_t* self_base_t::parent

Pointer to the parent reactor of this reactor instance.

Used to maintain the reactor hierarchy.

◆ reactor_mutex

void* self_base_t::reactor_mutex

Mutex used to protect the reactor from concurrent access.

If not null, this is expected to point to an lf_mutex_t. Not declared as lf_mutex_t to avoid dependency on platform.h.


The documentation for this struct was generated from the following file:
  • /Users/runner/work/reactor-c/reactor-c/include/core/lf_types.h