All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TimeSeriesObservation.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 TimeSeriesObservation.cpp
22 
23  \brief This file contains a class to represent a time series observation.
24 */
25 
26 //ST
27 #include "TimeSeriesObservation.h"
28 
29 
31  : m_time(t), m_value(v)
32 {
33 }
34 
36 {
37  return m_time.get();
38 }
39 
41 {
42  m_time.reset(t);
43 }
44 
46 {
47  return m_value.get();
48 }
49 
51 {
52  return atof(m_value->toString().c_str());
53 }
54 
56 {
57  return atoi(m_value->toString().c_str());
58 }
59 
61 {
62  return m_value->toString();
63 }
64 
66 {
67  return m_time->operator<(*other.getTime());
68 }
69 
71 {
72 }
73 
This file contains a class to represent a time series observation.
std::string getString() const
It returns the value as a string.
A class to represent an observation (time and value) of a time series.
TimeSeriesObservation(te::dt::DateTime *t, te::dt::AbstractData *v)
Constructor.
double getDouble() const
It returns the value as a double.
int getInt() const
It returns the value as a integer.
te::dt::AbstractData * getValue() const
It returns the value.
A base class for values that can be retrieved from the data access module.
Definition: AbstractData.h:57
bool operator<(const TimeSeriesObservation &other) const
Operator <.
void setTime(te::dt::DateTime *t)
It sets the date time.
te::dt::DateTime * getTime() const
It returns the date time.