reactor-c 1.0
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
port.h
Go to the documentation of this file.
1
42
43#ifndef PORT_H
44#define PORT_H
45
46#include <stdlib.h>
47#include <stdbool.h>
48#include "lf_token.h" // Defines token types and lf_port_base_t, lf_sparse_io_record
49
54#define LF_SPARSE_WIDTH_THRESHOLD 10
55
61#define LF_SPARSE_CAPACITY_DIVIDER 10
62
109
120
131#define lf_multiport_iterator(in) \
132 (_lf_multiport_iterator_impl((lf_port_base_t**)self->_lf_##in, self->_lf_##in##_width))
133
142
143#endif /* PORT_H */
int lf_multiport_next(lf_multiport_iterator_t *iterator)
Return the channel number of the next present input on the multiport or -1 if there are no more prese...
lf_multiport_iterator_t _lf_multiport_iterator_impl(lf_port_base_t **port, int width)
Given an array of pointers to port structs, return an iterator that can be used to iterate over the p...
Definitions for token objects, reference-counted wrappers around dynamically-allocated messages.
An iterator over a record of the subset of channels of a multiport that have present inputs.
Definition port.h:73
lf_port_base_t ** port
Array of port pointers to iterate over.
Definition port.h:99
int idx
Current position in the sparse record.
Definition port.h:90
int width
Total width of the multiport.
Definition port.h:107
int next
Index of the next present channel.
Definition port.h:81
Base type for ports.
Definition lf_token.h:202