reactor-c
1.0
C Runtime for Lingua Franca
Toggle main menu visibility
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
73
typedef
struct
lf_multiport_iterator_t
{
81
int
next
;
82
90
int
idx
;
91
99
lf_port_base_t
**
port
;
100
107
int
width
;
108
}
lf_multiport_iterator_t
;
109
119
lf_multiport_iterator_t
_lf_multiport_iterator_impl
(
lf_port_base_t
** port,
int
width);
120
131
#define lf_multiport_iterator(in) \
132
(_lf_multiport_iterator_impl((lf_port_base_t**)self->_lf_##in, self->_lf_##in##_width))
133
141
int
lf_multiport_next
(
lf_multiport_iterator_t
* iterator);
142
143
#endif
/* PORT_H */
lf_multiport_next
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_impl
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...
lf_token.h
Definitions for token objects, reference-counted wrappers around dynamically-allocated messages.
lf_multiport_iterator_t
An iterator over a record of the subset of channels of a multiport that have present inputs.
Definition
port.h:73
lf_multiport_iterator_t::port
lf_port_base_t ** port
Array of port pointers to iterate over.
Definition
port.h:99
lf_multiport_iterator_t::idx
int idx
Current position in the sparse record.
Definition
port.h:90
lf_multiport_iterator_t::width
int width
Total width of the multiport.
Definition
port.h:107
lf_multiport_iterator_t::next
int next
Index of the next present channel.
Definition
port.h:81
lf_port_base_t
Base type for ports.
Definition
lf_token.h:202
Users
runner
work
reactor-c
reactor-c
include
core
port.h
Generated on
for reactor-c by
1.17.0