Enums.h
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/Enums.h
22 
23  \brief General enumerations for the data type module.
24 */
25 
26 #ifndef __TERRALIB_DATETYPE_INTERNAL_ENUMS_H
27 #define __TERRALIB_DATETYPE_INTERNAL_ENUMS_H
28 
29 namespace te
30 {
31  namespace dt
32  {
33  /*!
34  \enum DateTimeType
35 
36  \brief The subtype of date and time type, based on ISO 8621.
37 
38  There are specific data types in this module to represent the types:
39  DATE, DATE_PERIOD, DATE_DURATION, TIME_DURATION, TIME_INSTANT, TIME_PERIOD,
40  TIME_INSTANT_TZ, TIME_PERIOD_TZ
41 
42  The type ORDINAL_TIME is represented by the te::dt::Int type.
43  The type STRING_TIME is represented by the te::dt::String type.
44  */
46  {
47  DATE, /*!< A gregorian date. Example: 10/01/2013 */
48  DATE_PERIOD, /*!< A date period represents a range between two dates. */
49  DATE_DURATION, /*!< Date duration is a simple day count used for arithmetic with DATE. Example: 3 */
50  TIME_DURATION, /*!< A length of time with nano-second/micro-second resolution (hh:mm:ss,ss) */
51  TIME_INSTANT, /*!< Date and Time instant data type (both date and local time). */
52  TIME_PERIOD, /*!< Date and time period data type (both date and local time). */
53  TIME_INSTANT_TZ, /*!< Time instant with time zone data type (both date and time with time zone). */
54  TIME_PERIOD_TZ, /*!< Time period with time zone data type (both date and time with time zone). */
55  ORDINAL_TIME_INSTANT, /*!< Ordinal time instant, for example: 1 -> Monday / 2 -> Tuesday / */
56  ORDINAL_TIME_PERIOD, /*!< A period of ordinal time */
57  STRING_TIME, /*!< A String that represents an instant of time "1999", "99". */
59  };
60 
61  /*!
62  \enum DateTimeStringFormat
63 
64  \brief The format of a string that represents a date and time.
65 
66  It is based on the date and time representations of ISO 8621.
67  It must be used in the DateTimeProperty when the type is STRING_TIME.
68  */
70  {
71  YYYY, /*!< A year with 4 numbers. Example: 1999 */
72  YY, /*!< A year with 2 numbers. Example: 99 */
73  YYYYMM, /*!< A year with 4 numbers and the month. Example: 199903 */
74  YYYYDDD, /*!< A year with 4 numbers and the ordianl day of the year. Example: 1999360 */
75  UNKNOWN_STRING_FORMAT /*!< Unknown string format. */
76  };
77 
78  /*!
79  \enum DateTimeOrdinalType
80 
81  \brief The meaning of the ordial time.
82 
83  It must be used in the DateTimeProperty when the type is ORDINAL_TIME.
84  */
86  {
87  MONTH_OF_YEAR, /*!< from 1 (January) to 12 (December) */
88  WEEK_OF_YEAR, /*!< from 1 to 52 */
89  DAY_OF_WEEK, /*!< from 1 (Monday) to 7 (Sunday) */
90  DAY_OF_MONTH, /*!< from 1 to 31 */
91  DAY_OF_YEAR, /*!< from 001 (01/01) to 365 ou 366 (31/12) */
92  HOUR_OF_DAY, /*!< from 0 to 23 */
93  MINUTE_OF_HOUR, /*!< from 0 to 59 */
94  SECOND_OF_MINUTE, /*!< from 0 to 59 */
95  USER_DEFINED /*!< A ordinal number defined by the user */
96  };
97 
98  /*!
99  \enum TemporalUnit
100 
101  \brief The unit of the temporal data
102  */
104  {
105  YEAR, /*!< Year. */
106  MONTH, /*!< Month */
107  DAY, /*!< Day */
108  HOUR, /*!< Hour */
109  MINUTE, /*!< Minute */
110  SECOND, /*!< Second */
111  WEEK, /*!< Week */
112  UNKNOWN_TEMPORAL_UNIT /*!< Unknown time unit. */
113  };
114 
115  /*!
116  \struct TemporalResolution
117 
118  \brief A temporal resolution is composed of a unit of time and a value.
119 
120  A temporal resolution is composed of a unit and a value. For example,
121  if the temporal resolution is 16 days, the unit is DAY and the value is 16.
122  */
124  {
126  unsigned int m_value;
127 
129  : m_unit(UNKNOWN_TEMPORAL_UNIT), m_value(0) { }
130 
131  TemporalResolution(TemporalUnit unit, unsigned int val)
132  : m_unit(unit), m_value(val) { }
133  };
134 
135  /*!
136  \enum TemporalRelation
137 
138  \brief Temporal relations between date and time (Source: Allen, 1991).
139  */
141  {
143  BEFORE = 1, /*!< */
144  AFTER = 2, /*!< */
145  DURING = 4, /*!< */
146  EQUALS = 8, /*!< */
147  MEETS = 16, /*!< */
148  OVERLAPS = 32, /*!< */
149  STARTS = 64, /*!< */
150  FINISHES = 128
151  };
152 
153  /*!
154  \enum BasicRelation
155 
156  \brief Relations between simple attribute values.
157  */
159  {
161  LESS = 1, /*!< */
162  MORE = 2, /*!< */
163  EQUAL = 4 /*!< */
164  };
165 
166  /*!
167  \enum StringType
168 
169  \brief The subtype of string property.
170  */
172  {
173  FIXED_STRING, /*!< For fixed-length strings (blank padded if needed). */
174  VAR_STRING, /*!< For variable length string with a limited size. */
175  STRING /*!< For variable unlimited length string. */
176  };
177 
178  /*!
179  \brief An anonymous union for all the basic data types supported by TerraLib.
180 
181  \warning If you change this list, please, update all code dependencies (for example: LAST_DATATYPE_CODE).
182  */
183  enum
184  {
185  UNKNOWN_TYPE = 0, /*!< Used when the data type is unknown. */
186  VOID_TYPE = 1, /*!< For void data types. */
187  BIT_TYPE = 2, /*!< Used for 1 bit data types. */
188  CHAR_TYPE = 3, /*!< Character data type (1 byte long). */
189  UCHAR_TYPE = 4, /*!< Unsigned character data type (1 byte long). */
190  INT16_TYPE = 5, /*!< Integer number data type (2 bytes long). */
191  UINT16_TYPE = 6, /*!< Unsigned Integer number data type (2 bytes long). */
192  INT32_TYPE = 7, /*!< Signed Integer number data type (4 bytes long). */
193  UINT32_TYPE = 8, /*!< Unsigned Integer number data type (4 bytes long). */
194  INT64_TYPE = 9, /*!< Signed Integer number data type (8 bytes long). */
195  UINT64_TYPE = 10, /*!< Unsigned Integer number data type (8 bytes long). */
196  BOOLEAN_TYPE = 11, /*!< Boolean type (true or false). */
197  FLOAT_TYPE = 12, /*!< Float number (32 bits) data type. */
198  DOUBLE_TYPE = 13, /*!< Double number (64 bits) data type. */
199  NUMERIC_TYPE = 14, /*!< Arbitrary precision data type: Numeric(p, q). */
200  STRING_TYPE = 15, /*!< String data type. */
201  BYTE_ARRAY_TYPE = 16, /*!< Binary data (BLOB). */
202  GEOMETRY_TYPE = 17, /*!< Geometry data type. */
203  DATETIME_TYPE = 18, /*!< Date and time data type. */
204  ARRAY_TYPE = 19, /*!< Array of homogeneous elements. */
205  COMPOSITE_TYPE = 20, /*!< Composed type. */
206  DATASET_TYPE = 21, /*!< When the type is a DataSet. */
207  RASTER_TYPE = 22, /*!< When the type is a Raster. */
208  CINT16_TYPE = 23, /*!< Complex signed integer number data type (2 + 2 bytes long). */
209  CINT32_TYPE = 24, /*!< Complex signed integer number data type (4 + 4 bytes long). */
210  CFLOAT_TYPE = 25, /*!< Complex float number (32 + 32 bits) data type. */
211  CDOUBLE_TYPE = 26, /*!< Complex double number (64 + 64 bits) data type. */
212  XML_TYPE = 27, /*!< XML data type. */
213  DATASETITEM_TYPE = 28, /*!< When the type is a DataSetItem. */
214  POLYMORPHIC_TYPE = 29, /*!< When the type is polymorphic. */
215  R4BITS_TYPE = 30, /*!< When the type is a raster with 4 bits. */
216  R2BITS_TYPE = 31, /*!< When the type is a raster with 2 bits. */
217  R1BIT_TYPE = 32 /*!< When the type is a raster with 1 bit. */
218  };
219 
220  /*! \brief An anonymous union that marks the last common data type supported by TerraLib. */
221  enum
222  {
224  };
225 
226  } // end namespace dt
227 } // end namespace te
228 
229 #endif // __TERRALIB_DATETYPE_INTERNAL_ENUMS_H
230 
StringType
The subtype of string property.
Definition: Enums.h:171
BasicRelation
Relations between simple attribute values.
Definition: Enums.h:158
DateTimeOrdinalType
The meaning of the ordial time.
Definition: Enums.h:85
TemporalRelation
Temporal relations between date and time (Source: Allen, 1991).
Definition: Enums.h:140
DateTimeStringFormat
The format of a string that represents a date and time.
Definition: Enums.h:69
TemporalUnit
The unit of the temporal data.
Definition: Enums.h:103
TemporalUnit m_unit
Definition: Enums.h:125
A temporal resolution is composed of a unit of time and a value.
Definition: Enums.h:123
TemporalResolution(TemporalUnit unit, unsigned int val)
Definition: Enums.h:131
URI C++ Library.
unsigned int m_value
Definition: Enums.h:126
DateTimeType
The subtype of date and time type, based on ISO 8621.
Definition: Enums.h:45