21 #ifndef TULIP_STLITERATOR_H 22 #define TULIP_STLITERATOR_H 23 #include <tulip/tuliphash.h> 24 #include <tulip/Iterator.h> 25 #include <tulip/memorypool.h> 29 template<
typename VALUE,
typename ITERATOR>
30 struct StlIterator:
public Iterator< VALUE > {
31 StlIterator(
const ITERATOR &startIt,
const ITERATOR &endIt):
54 template<
typename VALUE,
typename ITERATOR>
55 struct MPStlIterator:
public StlIterator< VALUE, ITERATOR >,
56 public MemoryPool<MPStlIterator<VALUE, ITERATOR> > {
57 MPStlIterator(
const ITERATOR &startIt,
const ITERATOR &endIt):
58 StlIterator<VALUE, ITERATOR>(startIt, endIt) {
62 template<
typename KEY,
typename VALUE>
63 struct StlHMapIterator:
public Iterator< std::pair<KEY,VALUE> > {
64 StlHMapIterator(
typename TLP_HASH_MAP<KEY,VALUE>::const_iterator startIt,
typename TLP_HASH_MAP<KEY,VALUE>::const_iterator endIt):
68 std::pair<KEY,VALUE> next();
71 typename TLP_HASH_MAP<KEY,VALUE>::const_iterator it, itEnd;
75 template<
typename KEY,
typename VALUE>
76 std::pair<KEY,VALUE> StlHMapIterator<KEY,VALUE>::next() {
77 std::pair<KEY,VALUE> tmp=*it;
81 template<
typename KEY,
typename VALUE>
82 bool StlHMapIterator<KEY,VALUE>::hasNext() {
88 template<
typename KEY,
typename VALUE>
89 struct StlHMapKeyIterator :
public tlp::Iterator<KEY> {
90 StlHMapKeyIterator(
typename TLP_HASH_MAP<KEY,VALUE>::const_iterator startIt,
typename TLP_HASH_MAP<KEY,VALUE>::const_iterator endIt):
95 const KEY tmp = it->first;
103 typename TLP_HASH_MAP<KEY,VALUE>::const_iterator it, itEnd;
Interface for Tulip iterators. Allows basic iteration operations only.