All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DateTimeProperty.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008-2013 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/DateTimeProperty.cpp
22 
23  \brief The type for date and time types: TIME_STAMP, TIME_STAMP_TZ, DATE, DATETIME, TIME or TIME_TZ.
24 */
25 
26 // TerraLib
27 #include "DateTimeProperty.h"
28 
30  DateTimeType dateType,
31  DateTimeResolution dtResolution,
32  bool isRequired,
33  std::string* defaultValue,
34  unsigned int id,
35  Property* parent)
36  : SimpleProperty(name, DATETIME_TYPE, isRequired, defaultValue, id, parent),
37  m_dSubType(dateType),
38  m_dtResolution(dtResolution)
39 {
40 }
41 
43  : SimpleProperty(rhs),
44  m_dSubType(rhs.m_dSubType),
45  m_dtResolution(rhs.m_dtResolution)
46 {
47 }
48 
50 {
51  if(this != &rhs)
52  {
54 
55  m_dSubType = rhs.m_dSubType;
56  m_dtResolution = rhs.m_dtResolution;
57  }
58 
59  return *this;
60 }
61 
63 {
64  return new DateTimeProperty(*this);
65 }
66 
DateTimeResolution
The date and time resolution.
Definition: Enums.h:57
DateTimeProperty & operator=(const DateTimeProperty &rhs)
Assignment operator.
An atomic property like an integer or double.
The type for date and time types: date, date period, date duration, time duration, time instant, time period, time instant with time zone or time period with time zone.
DateTimeResolution m_dtResolution
The date and time resolution.
DateTimeType
The subtype of date and time type.
Definition: Enums.h:38
DateTimeType m_dSubType
The sub-type of this date time property.
DateTimeProperty(const std::string &name, DateTimeType dateType=DATE, DateTimeResolution dtResolution=UNKNOWN, bool isRequired=false, std::string *defaultValue=0, unsigned int id=0, Property *parent=0)
It constructs a new date and time property.
It models a property definition.
Definition: Property.h:59
Property * clone() const
It returns a clone of the object.
SimpleProperty & operator=(const SimpleProperty &rhs)
Assignment operator.
The type for date and time types.