SOCA
GeometryIterator.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2019-2021 UCAR
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  */
7 
8 #ifndef SOCA_GEOMETRYITERATOR_GEOMETRYITERATOR_H_
9 #define SOCA_GEOMETRYITERATOR_GEOMETRYITERATOR_H_
10 
11 #include <iterator>
12 #include <string>
13 
14 #include "soca/Fortran.h"
15 
16 #include "oops/util/ObjectCounter.h"
17 #include "oops/util/Printable.h"
18 
19 // Forward declarations
20 namespace eckit {
21  namespace geometry {
22  class Point2;
23  }
24 }
25 namespace soca {
26  class Geometry;
27 }
28 
29 
30 namespace soca {
31 // -----------------------------------------------------------------------------
32 class GeometryIterator: public std::iterator<std::forward_iterator_tag,
33  eckit::geometry::Point2>,
34  public util::Printable,
35  private util::ObjectCounter<GeometryIterator> {
36  public:
37  static const std::string classname() {return "soca::GeometryIterator";}
38 
40  explicit GeometryIterator(const Geometry & geom,
41  const int & iindex = 1, const int & jindex = 1);
43 
44  bool operator==(const GeometryIterator &) const;
45  bool operator!=(const GeometryIterator &) const;
46  eckit::geometry::Point2 operator*() const;
48 
49  F90iter & toFortran() {return keyIter_;}
50  const F90iter & toFortran() const {return keyIter_;}
51 
52  private:
53  void print(std::ostream &) const;
55 };
56 
57 } // namespace soca
58 
59 #endif // SOCA_GEOMETRYITERATOR_GEOMETRYITERATOR_H_
Geometry handles geometry for SOCA model.
Definition: Geometry.h:48
void print(std::ostream &) const
GeometryIterator(const GeometryIterator &)
static const std::string classname()
const F90iter & toFortran() const
bool operator==(const GeometryIterator &) const
GeometryIterator & operator++()
eckit::geometry::Point2 operator*() const
bool operator!=(const GeometryIterator &) const
int F90iter
key type for soca_geom_iter_mod::soca_geom_iter
Definition: Fortran.h:17