CoverageSeriesIterator.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18 */
19 
20 /*!
21  \file CoverageSeriesIterator.h
22 
23  \brief This file contains an iterator that is able to traverse all observations
24  of a coverage series.
25 */
26 
27 #ifndef __TERRALIB_ST_INTERNAL_COVERAGESERIESITERATOR_H
28 #define __TERRALIB_ST_INTERNAL_COVERAGESERIESITERATOR_H
29 
30 // ST
31 #include "../../Config.h"
33 
34 // STL
35 #include <map>
36 
37 // Boost
38 #include <boost/shared_ptr.hpp>
39 
40 // Forward declarations
41 namespace te { namespace dt { class DateTime; } }
42 
43 namespace te
44 {
45  namespace st
46  {
47  //Forward declaration
48  class Coverage;
49 
50  /*!
51  \class CoverageSeriesIterator
52 
53  \brief A class to traverse the observations of a CoverageSeries.
54 
55  This class provides a mechanism to traverse the observations of
56  a CoverageSeries (time and coverage) ordered by time.
57 
58  An example of use:
59 
60  CoverageSeriesIterator it = cvs.begin();
61  while(it!=cvs.end())
62  {
63  DateTime* t = it.getTime();
64  Coverage* c = it.getCoverage();
65  ++it;
66  }
67 
68  \sa CoverageSeries
69  */
71  {
72  public:
73 
74  /*! \brief Empty constructor. */
76 
77  /*!
78  \brief Constructor.
79 
80  \param it A iterator that points to the point coverage observations
81  */
82  CoverageSeriesIterator(const CoverageSeriesObservationSet::const_iterator& it);
83 
84  /*! \brief Assignment operator. */
86 
87  /*! \brief Operator == */
89 
90  /*! \brief Operator != */
92 
93  /*!
94  \brief Prefix operator ++
95 
96  After using this operator, the internal cursor points
97  to the next coverage series observation.
98 
99  The semantics of prefix is this: Increment the value and then fetch it.
100  */
102 
103  /*!
104  \brief Postfix operator ++
105 
106  After using this operator, the internal cursor points
107  to the next coverage series observation.
108 
109  The semantics of postfix is: Fetch the value and then increment the original.
110  */
112 
113  /*!
114  \brief Prefix operator --
115 
116  After using this operator, the internal cursor points
117  to the preceding coverage series observation.
118 
119  The semantics of prefix is this: Increment the value and then fetch it.
120  */
122 
123  /*!
124  \brief Postfix operator --
125 
126  After using this operator, the internal cursor points
127  to the preceding coverage series observation.
128 
129  The semantics of postfix is: Fetch the value and then increment the original.
130  */
132 
133  /*!
134  \brief Prefix operator *
135 
136  It returns the observation (a pair of shared pointers to DateTime and Coverage)
137  pointed by the internal cursor.
138  */
140 
141  /*!
142  \brief It returns the time pointed by the internal cursor.
143 
144  \return A pointer to the time pointed by the internal cursor.
145 
146  \note The caller will NOT take the ownership of the returned pointer.
147  */
149 
150  /*!
151  \brief It returns the coverage pointed by the internal cursor.
152 
153  \return A pointer to the coverage pointed by the internal cursor.
154 
155  \note The caller will NOT take the ownership of the returned pointer.
156  */
158 
159  /*! \brief Virtual destructor. */
161 
162  private:
163 
164  CoverageSeriesObservationSet::const_iterator m_it; //!< The internal cursor
165  };
166  } // end namespace st
167 } // end namespace te
168 
169 #endif // __TERRALIB_ST_INTERNAL_COVERAGESERIESITERATOR_H
170 
171 
te::st::CoverageSeriesIterator::operator==
bool operator==(const CoverageSeriesIterator &rhs)
Operator ==.
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::dt::DateTime
Definition: DateTime.h:56
te::st::CoverageSeriesIterator::CoverageSeriesIterator
CoverageSeriesIterator()
Empty constructor.
te::st::CoverageSeriesIterator::~CoverageSeriesIterator
virtual ~CoverageSeriesIterator()
Virtual destructor.
te::st::CoverageSeriesIterator::operator=
const CoverageSeriesIterator & operator=(const CoverageSeriesIterator &rhs)
Assignment operator.
te::st::CoverageSeriesObservation
std::pair< te::dt::DateTimeShrPtr, CoverageShrPtr > CoverageSeriesObservation
Definition: CoverageSeriesObservation.h:46
te::st::CoverageSeriesIterator::operator++
CoverageSeriesIterator & operator++()
Prefix operator ++.
te::st::CoverageSeriesIterator::CoverageSeriesIterator
CoverageSeriesIterator(const CoverageSeriesObservationSet::const_iterator &it)
Constructor.
te::st::CoverageSeriesIterator
A class to traverse the observations of a CoverageSeries.
Definition: CoverageSeriesIterator.h:71
CoverageSeriesObservation.h
This file contains a class to represent a CoverageSeries observation.
te::st::CoverageSeriesIterator::getCoverage
te::st::Coverage * getCoverage() const
It returns the coverage pointed by the internal cursor.
te::st::CoverageSeriesIterator::operator!=
bool operator!=(const CoverageSeriesIterator &rhs)
Operator !=.
TESTEXPORT
#define TESTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:88
te::st::CoverageSeriesIterator::m_it
CoverageSeriesObservationSet::const_iterator m_it
The internal cursor.
Definition: CoverageSeriesIterator.h:164
te::st::Coverage
An abstract class to represent a coverage.
Definition: Coverage.h:64
te::st::CoverageSeriesIterator::operator++
CoverageSeriesIterator operator++(int aux)
Postfix operator ++.
te::st::CoverageSeriesIterator::getTime
te::dt::DateTime * getTime() const
It returns the time pointed by the internal cursor.
te::st::CoverageSeriesIterator::operator--
CoverageSeriesIterator & operator--()
Prefix operator –.
te::st::CoverageSeriesIterator::operator*
CoverageSeriesObservation operator*() const
Prefix operator *.
te::st::CoverageSeriesIterator::operator--
CoverageSeriesIterator operator--(int aux)
Postfix operator –.