21 #ifndef TULIP_STABLEITERATOR_H
22 #define TULIP_STABLEITERATOR_H
23 #include <tulip/Iterator.h>
24 #include <tulip/tulipconf.h>
55 template<
class itType>
56 struct StableIterator :
public Iterator<itType> {
65 StableIterator(Iterator<itType> *inputIterator,
size_t nbElements = 0,
bool deleteIterator =
true) {
66 sequenceCopy.reserve(nbElements);
68 for (; inputIterator->hasNext();) {
69 sequenceCopy.push_back(inputIterator->next());
75 copyIterator = sequenceCopy.begin();
81 itType tmp(*copyIterator);
87 return (copyIterator != sequenceCopy.end());
97 copyIterator = sequenceCopy.begin();
104 std::vector<itType> sequenceCopy;
109 typename std::vector<itType>::const_iterator copyIterator;