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

An iterator over a record of the subset of channels of a multiport that have present inputs. More...

#include <port.h>

Data Fields

int idx
 Current position in the sparse record.
int next
 Index of the next present channel.
lf_port_base_t ** port
 Array of port pointers to iterate over.
int width
 Total width of the multiport.

Detailed Description

An iterator over a record of the subset of channels of a multiport that have present inputs.

To use this, create an iterator using the function lf_multiport_iterator(). That function returns a struct that can be passed to the lf_multiport_next() function to obtain the next channel number of a present input (or -1 if there is no next present input).

Field Documentation

◆ idx

int lf_multiport_iterator_t::idx

Current position in the sparse record.

Tracks the current position in the sparse record array. Set to -1 if lf_multiport_next() has not been called yet. Used internally to iterate through the present channels.

◆ next

int lf_multiport_iterator_t::next

Index of the next present channel.

Stores the channel index of the next present input to be returned by lf_multiport_next(). This is updated each time lf_multiport_next() is called to point to the next present channel.

◆ port

lf_port_base_t** lf_multiport_iterator_t::port

Array of port pointers to iterate over.

Points to the array of port structs that make up the multiport. This is used to check the presence of each channel and access their values.

◆ width

int lf_multiport_iterator_t::width

Total width of the multiport.

Indicates the total number of channels in the multiport. Used to determine when we've reached the end of the iteration.


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