gatb.core-API-0.0.0
|
Iterator over two iterators. More...
#include <IteratorHelpers.hpp>
Public Member Functions | |
ProductIterator (Iterator< T1 > &it1, Iterator< T2 > &it2) | |
virtual | ~ProductIterator () |
void | first () |
void | next () |
bool | isDone () |
std::pair< T1, T2 > & | item () |
Public Member Functions inherited from Iterator< std::pair< T1, T2 > > | |
std::pair< T1, T2 > * | operator-> () |
std::pair< T1, T2 > & | operator* () |
void | iterate (const Functor &f) |
virtual void | setItem (std::pair< T1, T2 > &i) |
bool | get (std::vector< std::pair< T1, T2 > > ¤t) |
virtual void | reset () |
virtual void | finalize () |
virtual std::vector< Iterator< std::pair< T1, T2 > > * > | getComposition () |
Public Member Functions inherited from SmartPointer | |
void | use () |
void | forget () |
Public Member Functions inherited from ISmartPointer | |
virtual | ~ISmartPointer () |
Additional Inherited Members | |
Protected Member Functions inherited from SmartPointer | |
SmartPointer () | |
virtual | ~SmartPointer () |
Iterator over two iterators.
We define a "product" iterator for two iterators, i.e. it will loop each possible couple of the two provided iterators.
It is useful for having only one loop instead of two loops. Note however that it may still be more efficient to have two loops. The CartesianIterator is just here for easing the product iteration on small sets.
NOTE: most likely it doesn't work in combination with Dispatcher, see PairedIterator for how to fix
Example:
|
inline |
Constructor.
[in] | it1 | : first iterator. |
[in] | it2 | : second iterator. |
|
inlinevirtual |
Destructor.
|
inlinevirtual |
Method that initializes the iteration.
Implements Iterator< std::pair< T1, T2 > >.
|
inlinevirtual |
Method telling whether the iteration is finished or not.
Implements Iterator< std::pair< T1, T2 > >.
|
inlinevirtual |
Method that returns the current iterated item. Note that the returned type is the template type.
Implements Iterator< std::pair< T1, T2 > >.
|
inlinevirtual |
Method that goes to the next item in the iteration.
Implements Iterator< std::pair< T1, T2 > >.