TrajectoryIterator.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 TrajectoryIterator.cpp
22 
23  \brief This file contains a trajetory iterator.
24 */
25 
26 //ST
27 #include "TrajectoryIterator.h"
28 
30 
31 te::st::TrajectoryIterator::TrajectoryIterator(TrajectoryObservationSet::const_iterator& it)
32  : m_it(it)
33 {
34 }
35 
38 {
39  if(this == &rhs)
40  return *this;
41 
42  m_it = rhs.m_it;
43  return *this;
44 }
45 
47 {
48  return m_it == rhs.m_it;
49 }
50 
52 {
53  return m_it != rhs.m_it;
54 }
55 
57 {
58  ++m_it;
59  return *this;
60 }
61 
63 {
64  te::st::TrajectoryIterator result = *this;
65  ++m_it;
66  return result;
67 }
68 
70 {
71  --m_it;
72  return *this;
73 }
74 
76 {
77  te::st::TrajectoryIterator result = *this;
78  --m_it;
79  return result;
80 }
81 
83 {
84  return *m_it;
85 }
86 
88 {
89  return m_it->second.get();
90 }
91 
93 {
94  return m_it->first.get();
95 }
96 
TrajectoryObservation operator*() const
Prefix operator *.
TrajectoryIterator & operator++()
Prefix operator ++.
te::gm::Geometry * getGeometry() const
It returns the geometry pointed by the internal cursor.
bool operator!=(const TrajectoryIterator &rhs)
Operator !=.
virtual ~TrajectoryIterator()
Virtual destructor.
This file contains a trajetory iterator.
std::pair< te::dt::DateTimeShrPtr, te::gm::GeometryShrPtr > TrajectoryObservation
TrajectoryIterator & operator--()
Prefix operator –.
const TrajectoryIterator & operator=(const TrajectoryIterator &rhs)
Assignment operator.
TrajectoryIterator()
Empty constructor.
bool operator==(const TrajectoryIterator &rhs)
Operator ==.
te::dt::DateTime * getTime() const
It returns the datetime pointed by the internal cursor.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
A class to traverse the observations of a trajectory.
TrajectoryObservationSet::const_iterator m_it
The internal cursor.