#include <pipeline.h>
Public Member Functions | |
| pipe_itr () | |
| pipe_itr (const Reader &pipRd) | |
| This initialize the internal reader, and reads the first value. | |
| pipe_itr (const pipe_itr &anIter) | |
| const ValueType & | operator * (void) const |
| First checks there is data to read. If not, the program has a logic error. | |
| const ValueType * | operator-> (void) const |
| First checks there is data to read. If not, the program has a logic error. | |
| pipe_itr & | operator++ (void) |
| Invalidates the value in the iterator. So, there will be a read next time. | |
| pipe_itr & | operator++ (int) |
| Invalidates the value in the iterator. So, there will be a read next time. | |
| bool | operator== (const pipe_itr &anIt) const |
| bool | operator!= (const pipe_itr &anIt) const |
| Just negates 'operator=='. | |
Private Member Functions | |
| void | update (void) const |
Private Attributes | |
| Reader | _reader |
| Stores the logic to read from a pipe_circular or pipe_archiver. | |
| ValueType | _val |
| bool | _ok |
It blocks until there is data to read. It is compatible with STL algorithms (If used as input_iterator).
| rpa::pipe_itr< ValueType, Reader >::pipe_itr | ( | ) | [inline] |
| rpa::pipe_itr< ValueType, Reader >::pipe_itr | ( | const Reader & | pipRd | ) | [inline] |
This initialize the internal reader, and reads the first value.
| rpa::pipe_itr< ValueType, Reader >::pipe_itr | ( | const pipe_itr< ValueType, Reader > & | anIter | ) | [inline] |
| const ValueType& rpa::pipe_itr< ValueType, Reader >::operator * | ( | void | ) | const [inline] |
First checks there is data to read. If not, the program has a logic error.
| bool rpa::pipe_itr< ValueType, Reader >::operator!= | ( | const pipe_itr< ValueType, Reader > & | anIt | ) | const [inline] |
Just negates 'operator=='.
| pipe_itr& rpa::pipe_itr< ValueType, Reader >::operator++ | ( | int | ) | [inline] |
Invalidates the value in the iterator. So, there will be a read next time.
| pipe_itr& rpa::pipe_itr< ValueType, Reader >::operator++ | ( | void | ) | [inline] |
Invalidates the value in the iterator. So, there will be a read next time.
| const ValueType* rpa::pipe_itr< ValueType, Reader >::operator-> | ( | void | ) | const [inline] |
First checks there is data to read. If not, the program has a logic error.
| bool rpa::pipe_itr< ValueType, Reader >::operator== | ( | const pipe_itr< ValueType, Reader > & | anIt | ) | const [inline] |
Beware that the logic is different than, for example, ostream_iterator. it may not work with all types of algorithms. This ensures first that there is a data to read if this is possible.
| void rpa::pipe_itr< ValueType, Reader >::update | ( | void | ) | const [inline, private] |
This reads the next value in advance, only if the previous read did not work: This avoids to read two values without using them.
bool rpa::pipe_itr< ValueType, Reader >::_ok [mutable, private] |
Reader rpa::pipe_itr< ValueType, Reader >::_reader [mutable, private] |
Stores the logic to read from a pipe_circular or pipe_archiver.
ValueType rpa::pipe_itr< ValueType, Reader >::_val [mutable, private] |
This is used as a buffer : When the iterator is created or when it is incremented, it reads one value ahead, just like a std::istream_iterator. It has the same drawback : One extra data copy for nothing.
1.4.7