00001 #ifndef GRAL_GB_CELL_ITERATOR_INT_H
00002 #define GRAL_GB_CELL_ITERATOR_INT_H
00003
00004
00005
00012 template<class GRID>
00013 class int_cell_iterator {
00014 typedef int_cell_iterator<GRID> self;
00015 public:
00016 typedef GRID grid_type;
00017 protected:
00018 grid_type const* g;
00019 int c;
00020 public:
00021 int_cell_iterator() : g(0), c(-1) {}
00022 explicit
00023 int_cell_iterator(grid_type const& gg, int cc = 0) : g(&gg), c(cc) {}
00024
00025 self & operator++() { ++c; return *this;}
00026 self const& operator*() const { return *this;}
00027 grid_type const& TheGrid() const { return *g;}
00028 bool IsDone() const { return (c >= g->NumOfCells());}
00029 int handle() const { return c;}
00030
00031 bool operator==(self const& rhs) const { return (rhs.c == c) && (rhs.g == g);}
00032 bool operator!=(self const& rhs) const { return !((*this) == rhs);}
00033 };
00034
00035 #endif
00036