All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
32 
33 te::st::TrajectoryIterator::TrajectoryIterator(TrajectoryObservationSet::const_iterator& it)
34  : m_it(it)
35 {
36 }
37 
40 {
41  if(this == &rhs)
42  return *this;
43 
44  m_it = rhs.m_it;
45  return *this;
46 }
47 
49 {
50  return m_it == rhs.m_it;
51 }
52 
54 {
55  return m_it != rhs.m_it;
56 }
57 
59 {
60  ++m_it;
61  return *this;
62 }
63 
65 {
66  te::st::TrajectoryIterator result = *this;
67  ++m_it;
68  return result;
69 }
70 
72 {
73  --m_it;
74  return *this;
75 }
76 
78 {
79  te::st::TrajectoryIterator result = *this;
80  --m_it;
81  return result;
82 }
83 
85 {
86  return *m_it;
87 }
88 
90 {
91  return m_it->second.get();
92 }
93 
95 {
96  return m_it->first.get();
97 }
98 
100 {
101 }
102 
103 
104 
105 
106 
107 
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.
Definition: Geometry.h:73
A class to traverse the observations of a trajectory.
TrajectoryObservationSet::const_iterator m_it
The internal cursor.