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