![]() |
reactor-c 1.0
C Runtime for Lingua Franca
|
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. | |
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).
| 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.
| 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.
| 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.
| 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.