All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OrdinalInstant.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 terralib/datatype/OrdinalInstant.cpp
22 
23  \brief A class to represent ordinal time instant.
24 */
25 
26 // TerraLib
27 #include "OrdinalInstant.h"
28 
30  : m_timeInstant(0)
31 {
32 }
33 
35  : m_timeInstant(t)
36 {
37 }
38 
40 {
41  const te::dt::OrdinalInstant* t = dynamic_cast<const te::dt::OrdinalInstant*>(&rhs);
42  return m_timeInstant.getValue() == t->m_timeInstant.getValue();
43 }
44 
46 {
47  const te::dt::OrdinalInstant* t = dynamic_cast<const te::dt::OrdinalInstant*>(&rhs);
48  return m_timeInstant.getValue() != t->m_timeInstant.getValue();
49 }
50 
52 {
53  const te::dt::OrdinalInstant* t = dynamic_cast<const te::dt::OrdinalInstant*>(&rhs);
54  return m_timeInstant.getValue() < t->m_timeInstant.getValue();
55 }
56 
58 {
59  const te::dt::OrdinalInstant* t = dynamic_cast<const te::dt::OrdinalInstant*>(&rhs);
60  return m_timeInstant.getValue() > t->m_timeInstant.getValue();
61 }
62 
64 {
65  return new OrdinalInstant(*this);
66 }
67 
69 {
70  return m_timeInstant.toString();
71 }
72 
T getValue() const
It returns the associated value.
Definition: SimpleData.h:139
std::string toString() const
It returns the time instant in a textual format.
OrdinalInstant()
Empty constructor.
bool operator>(const DateTime &rhs) const
Operator >
A class to represent ordinal time instant.
A base class for values that can be retrieved from the data access module.
Definition: AbstractData.h:57
Int64 m_timeInstant
The internal time instant information.
AbstractData * clone() const
It returns a clone of this object.
bool operator==(const DateTime &rhs) const
Operator ==.
A class to represent ordinal time instant.
bool operator!=(const DateTime &rhs) const
Operator !=.
bool operator<(const DateTime &rhs) const
Operator <.