21 #ifndef TULIP_STLITERATOR_H
22 #define TULIP_STLITERATOR_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 StlMapIterator:
public Iterator< std::pair<KEY,VALUE> > {
64 StlMapIterator(
typename std::map<KEY,VALUE>::const_iterator startIt,
typename std::map<KEY,VALUE>::const_iterator endIt):
68 std::pair<KEY,VALUE> next();
71 typename std::map<KEY,VALUE>::const_iterator it, itEnd;
75 template<
typename KEY,
typename VALUE>
76 std::pair<KEY,VALUE> StlMapIterator<KEY,VALUE>::next() {
77 std::pair<KEY,VALUE> tmp=*it;
81 template<
typename KEY,
typename VALUE>
82 bool StlMapIterator<KEY,VALUE>::hasNext() {
88 template<
typename KEY,
typename VALUE>
89 struct StlMapKeyIterator :
public tlp::Iterator<KEY> {
90 StlMapKeyIterator(
typename std::map<KEY,VALUE>::const_iterator startIt,
typename std::map<KEY,VALUE>::const_iterator endIt):
95 const KEY tmp = it->first;
103 typename std::map<KEY,VALUE>::const_iterator it, itEnd;