openModeller  Version 1.5.0
MapIterator.hh
Go to the documentation of this file.
1 
29 #ifndef MAP_ITER_HH
30 #define MAP_ITER_HH
31 
32 #include <openmodeller/om_defs.hh>
33 
34 // For pair
35 #include <utility>
36 
38 class GeoTransform;
39 
40 class dllexp MapIterator {
41 
42  friend dllexp bool operator == ( const MapIterator&, const MapIterator& );
43  friend dllexp bool operator != ( const MapIterator&, const MapIterator& );
44 
45 public:
46  // Default constructor create a Terminal object which can be used in
47  // while (miter != MapIterator() {} loops.
48  MapIterator();
49 
50  MapIterator( const Header& h, GeoTransform* gt );
51 
52  // Compiler generated copy constructor, assignment operator and destructor
53  // are ok.
54 
55  // returns the current position in geo coordinates.
56  // first is x, second is y.
57  std::pair<Coord,Coord> operator*() const;
58 
59  // prefix operator++
60  MapIterator& operator++();
61 
62  // prefix operator--
63  MapIterator& operator--();
64 
65  // postfix operator++
66  MapIterator operator++( int );
67 
68  // postfix operator--
69  MapIterator operator--( int );
70 
71  #ifdef MPI_FOUND
72  //method added for the parallel version
73  void nextblock(int init);
74  #endif
75 
76 private:
77  bool isPastBounds() const;
78  // If isTerminal is true, then this MapIterator object
79  // represents the terminal condition.
80  bool isTerminal;
81 
84  int xcur;
85  int ycur;
86 };
87 
88 #endif
Definition: Header.hh:45
bool operator==(const MapIterator &lhs, const MapIterator &rhs)
GeoTransform * gt
Definition: MapIterator.hh:82
bool operator!=(const MapIterator &lhs, const MapIterator &rhs)
bool isTerminal
Definition: MapIterator.hh:80