CoverageSeriesIterator.cpp
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.cpp
22 
23  \brief This file contains an iterator that is able to traverse all observations
24  of a coverage series.
25 */
26 
27 //ST
28 #include "CoverageSeriesIterator.h"
29 
31 
32 te::st::CoverageSeriesIterator::CoverageSeriesIterator(const CoverageSeriesObservationSet::const_iterator& it) :
33  m_it(it)
34 {
35 }
36 
39 {
40  if(this == &rhs)
41  return *this;
42 
43  m_it = rhs.m_it;
44  return *this;
45 }
46 
48 {
49  return m_it == rhs.m_it;
50 }
51 
53 {
54  return m_it != rhs.m_it;
55 }
56 
58 {
59  ++m_it;
60  return *this;
61 }
62 
64 {
65  te::st::CoverageSeriesIterator result = *this;
66  ++m_it;
67  return result;
68 }
69 
71 {
72  --m_it;
73  return *this;
74 }
75 
77 {
78  te::st::CoverageSeriesIterator result = *this;
79  --m_it;
80  return result;
81 }
82 
84 {
85  return *m_it;
86 }
87 
89 {
90  return m_it->first.get();
91 }
92 
94 {
95  return m_it->second.get();
96 }
97 
CoverageSeriesIterator()
Empty constructor.
std::pair< te::dt::DateTimeShrPtr, CoverageShrPtr > CoverageSeriesObservation
bool operator==(const CoverageSeriesIterator &rhs)
Operator ==.
CoverageSeriesIterator & operator++()
Prefix operator ++.
This file contains an iterator that is able to traverse all observations of a coverage series...
A class to traverse the observations of a CoverageSeries.
CoverageSeriesObservation operator*() const
Prefix operator *.
bool operator!=(const CoverageSeriesIterator &rhs)
Operator !=.
CoverageSeriesObservationSet::const_iterator m_it
The internal cursor.
CoverageSeriesIterator & operator--()
Prefix operator –.
te::st::Coverage * getCoverage() const
It returns the coverage pointed by the internal cursor.
te::dt::DateTime * getTime() const
It returns the time pointed by the internal cursor.
virtual ~CoverageSeriesIterator()
Virtual destructor.
An abstract class to represent a coverage.
Definition: Coverage.h:63
const CoverageSeriesIterator & operator=(const CoverageSeriesIterator &rhs)
Assignment operator.