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

Base type for ports. More...

#include <lf_token.h>

Data Fields

int destination_channel
 Channel index for the destination port.
bool is_present
 Indicates whether the port has a present value.
int num_destinations
 Number of destination reactors.
self_base_tsource_reactor
 Pointer to the source reactor.
lf_sparse_io_record_tsparse_record
 Record of present channels for sparse I/O.
token_template_t tmplt
 Template containing type and token information.

Detailed Description

Base type for ports.

Port structs are customized types because their payloads are type specific. This struct represents their common features. Given any pointer to a port struct, it can be cast to lf_port_base_t and then these common fields can be accessed.

IMPORTANT: If this is changed, it must also be changed in CPortGenerator.java generateAuxiliaryStruct().

Field Documentation

◆ destination_channel

int lf_port_base_t::destination_channel

Channel index for the destination port.

Indicates which channel this port writes to in its destination reactor. Set to -1 if there is no destination or if this is not a multiport connection.

◆ is_present

bool lf_port_base_t::is_present

Indicates whether the port has a present value.

Set to true when the port has a value present at the current tag. This flag is used to determine whether the port's value should be considered in reactions.

◆ num_destinations

int lf_port_base_t::num_destinations

Number of destination reactors.

Indicates how many reactors this port writes to. For simple connections, this will be 1. For multiport connections, this may be greater than 1.

◆ source_reactor

self_base_t* lf_port_base_t::source_reactor

Pointer to the source reactor.

Points to the self struct of the reactor that provides data to this port. For input ports, this typically points to the container of the output port that sends data to this port.

◆ sparse_record

lf_sparse_io_record_t* lf_port_base_t::sparse_record

Record of present channels for sparse I/O.

Points to a record that tracks which channels of a multiport have present inputs. NULL if this port is not using sparse I/O or if it's not a multiport.

◆ tmplt

token_template_t lf_port_base_t::tmplt

Template containing type and token information.

This field contains the common token handling structure that allows the port to carry typed values. The template provides type information and manages the token's lifecycle.

Note
'template' is a C++ keyword, hence the abbreviated name.

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