![]() |
reactor-c 1.0
C Runtime for Lingua Franca
|
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_t * | source_reactor |
| Pointer to the source reactor. | |
| lf_sparse_io_record_t * | sparse_record |
| Record of present channels for sparse I/O. | |
| token_template_t | tmplt |
| Template containing type and token information. | |
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().
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.