20 #ifndef TULIP_STABLEITERATOR_H 21 #define TULIP_STABLEITERATOR_H 27 #include <tulip/Iterator.h> 28 #include <tulip/StlIterator.h> 29 #include <tulip/tulipconf.h> 73 bool sortCopy =
false) {
76 for (; inputIterator->
hasNext();) {
151 template <
typename Container>
152 typename std::enable_if<has_const_iterator<Container>::value,
virtual T next()=0
Moves the Iterator on the next element.
Interface for Tulip iterators. Allows basic iteration operations only.
Stores the elements of an iterator and iterates a copy.
void restart()
Restarts the iteration by moving the Iterator to the beginning of the sequence.
bool hasNext()
Tells if the sequence is at its end.
std::vector< T > sequenceCopy
A copy of the sequence of the elements to iterate.
StableIterator(Iterator< T > *inputIterator, size_t nbElements=0, bool deleteIterator=true, bool sortCopy=false)
Creates a stable Iterator, that allows to delete elements from a graph while iterating on them...
T next()
Moves the Iterator on the next element.
StableIterator< T > * stableIterator(Iterator< T > *it)
Convenient function for creating a StableIterator.
virtual bool hasNext()=0
Tells if the sequence is at its end.
std::enable_if< has_const_iterator< Container >::value, StlIterator< typename Container::value_type, typename Container::const_iterator > * >::type stlIterator(const Container &stlContainer)
Convenient function for creating a StlIterator from a stl container.
std::vector< T >::const_iterator copyIterator
STL const_iterator on the cloned sequence.