Walls And Holes  1
dereferencingiterator.h
Go to the documentation of this file.
1 #ifndef DEREFERENCINGITERATOR_H
2 #define DEREFERENCINGITERATOR_H
3 
4 
10 template< typename ObjectType, typename IteratorType >
12 {
13 public:
14  DereferencingIterator(IteratorType itr) : mItr(itr) {}
15 
16 
17  ObjectType &operator *()
18  {
19  return **mItr;
20  }
21 
23  {
24  return other.mItr == mItr;
25  }
26 
28  {
29  return other.mItr != mItr;
30  }
31 
33  {
34  ++mItr;
35  return *this;
36  }
37 
39  {
41  }
42 
43 private:
44  IteratorType mItr;
45 };
46 
47 #endif // DEREFERENCINGITERATOR_H
A helper class to provide an iterator into a collection of pointers such that when the iterator is de...
Definition: dereferencingiterator.h:11
bool operator==(const DereferencingIterator< ObjectType, IteratorType > &other) const
Definition: dereferencingiterator.h:22
DereferencingIterator< ObjectType, IteratorType > operator++(int)
Definition: dereferencingiterator.h:38
ObjectType & operator*()
Definition: dereferencingiterator.h:17
DereferencingIterator< ObjectType, IteratorType > & operator++()
Definition: dereferencingiterator.h:32
DereferencingIterator(IteratorType itr)
Definition: dereferencingiterator.h:14
bool operator!=(const DereferencingIterator< ObjectType, IteratorType > &other) const
Definition: dereferencingiterator.h:27