gatb.core-API-0.0.0
|
Composite iterator. More...
#include <IteratorHelpers.hpp>
Public Member Functions | |
CompositeIterator (std::vector< Iterator< Item > * > &iterators) | |
virtual | ~CompositeIterator () |
void | first () |
void | next () |
bool | isDone () |
Item & | item () |
void | setItem (Item &i) |
virtual std::vector< Iterator< Item > * > | getComposition () |
Public Member Functions inherited from Iterator< Item > | |
Item * | operator-> () |
Item & | operator* () |
template<typename Functor > | |
void | iterate (const Functor &f) |
bool | get (std::vector< Item > ¤t) |
virtual void | reset () |
virtual void | finalize () |
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 () |
Composite iterator.
This iterator takes a list of iterators as input and iterates each one of these iterators.
Example:
|
inline |
Constructor.
[in] | iterators | : the iterators vector |
|
inlinevirtual |
Destructor.
|
inlinevirtual |
Method that initializes the iteration.
Implements Iterator< Item >.
|
inlinevirtual |
Get a vector holding the composite structure of the iterator.
Reimplemented from Iterator< Item >.
|
inlinevirtual |
Method telling whether the iteration is finished or not.
Implements Iterator< Item >.
|
inlinevirtual |
Method that returns the current iterated item. Note that the returned type is the template type.
Implements Iterator< Item >.
|
inlinevirtual |
Method that goes to the next item in the iteration.
Implements Iterator< Item >.
|
inlinevirtual |
IMPORTANT : the Item argument provided to 'setItem' must be the object to be modified by one of the delegate iterator AND NOT the current item of CompositeIterator. Therefore, we make point the delegate current item to this provided Item argument.
Reimplemented from Iterator< Item >.