Class Fifo_iterator: Enables access to the Fifos while hiding their implementation in shared memory.
Class Fifo_iterator: Enables access to the Fifos while hiding their implementation in shared memory.The Fifos reside in shared memory as a fixed length array. An available slot may or may not be occupied by a Fifo. Fifo_iterator allows to iterate in forward direction over the occpupied slots (the unoccupied slots are ignored).
A typical use of the iterator is as follows:
// creates an initialises the iterator to the INPUT fifo Fifo_iterator it_inp(fifos, "INPUT"); if ( ! it_inp.valid() ) cout << "INPUT fifo not found"; // creates an arbitrary iterator - fifos is a pointer to the Fifo_system Fifo_iterator it( fifos ); // iterates over the all the fifos of the system fifos for ( it.first(); ! it.is_done(); it.next() ) { if ( ! (*it)->in_use() ) { // this should never happen as we iterate only over the fifos // that are in use ! } if ( it != it_inp ) { // do something } }Modifications:
Alphabetic index HTML hierarchy of classes or Java