All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EnumDataType.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 EnumDataType.cpp
22 
23  \brief
24 
25  \ingroup layout
26 */
27 
28 // TerraLib
29 #include "EnumDataType.h"
30 
32  m_dataTypeNone(0),
33  m_dataTypeInt(0),
34  m_dataTypeDouble(0),
35  m_dataTypeLong(0),
36  m_dataTypeFloat(0),
37  m_dataTypeString(0),
38  m_dataTypeBool(0),
39  m_dataTypeColor(0),
40  m_dataTypeGridSettings(0),
41  m_dataTypeStringList(0),
42  m_dataTypeFont(0),
43  m_dataTypeImage(0),
44  m_dataTypeTextGridSettings(0),
45  m_dataTypeGroup(0)
46 {
47  init();
48 }
49 
51 {
52  if(m_dataTypeNone)
53  {
54  delete m_dataTypeNone;
55  m_dataTypeNone = 0;
56  }
57  if(m_dataTypeInt)
58  {
59  delete m_dataTypeInt;
60  m_dataTypeInt = 0;
61  }
62  if(m_dataTypeDouble)
63  {
64  delete m_dataTypeDouble;
65  m_dataTypeDouble = 0;
66  }
67  if(m_dataTypeLong)
68  {
69  delete m_dataTypeLong;
70  m_dataTypeLong = 0;
71  }
72  if(m_dataTypeFloat)
73  {
74  delete m_dataTypeFloat;
75  m_dataTypeFloat = 0;
76  }
77  if(m_dataTypeString)
78  {
79  delete m_dataTypeString;
80  m_dataTypeString = 0;
81  }
82  if(m_dataTypeBool)
83  {
84  delete m_dataTypeBool;
85  m_dataTypeBool = 0;
86  }
87  if(m_dataTypeGridSettings)
88  {
89  delete m_dataTypeGridSettings;
90  m_dataTypeGridSettings = 0;
91  }
92  if(m_dataTypeStringList)
93  {
94  delete m_dataTypeStringList;
95  m_dataTypeStringList = 0;
96  }
97  if(m_dataTypeFont)
98  {
99  delete m_dataTypeFont;
100  m_dataTypeFont = 0;
101  }
102  if(m_dataTypeImage)
103  {
104  delete m_dataTypeImage;
105  m_dataTypeImage = 0;
106  }
107  if(m_dataTypeTextGridSettings)
108  {
109  delete m_dataTypeTextGridSettings;
110  m_dataTypeTextGridSettings = 0;
111  }
112  if(m_dataTypeGroup)
113  {
114  delete m_dataTypeGroup;
115  m_dataTypeGroup = 0;
116  }
117 }
118 
120 {
121  m_dataTypeNone = new EnumType(0, "None", this);
122  m_enums.push_back(m_dataTypeNone);
123 
124  m_dataTypeInt = new EnumType(1, "Int", this);
125  m_enums.push_back(m_dataTypeInt);
126 
127  m_dataTypeDouble = new EnumType(2, "Double", this);
128  m_enums.push_back(m_dataTypeDouble);
129 
130  m_dataTypeLong = new EnumType(3, "Long", this);
131  m_enums.push_back(m_dataTypeLong);
132 
133  m_dataTypeFloat = new EnumType(4, "Float", this);
134  m_enums.push_back(m_dataTypeFloat);
135 
136  m_dataTypeString = new EnumType(5, "String", this);
137  m_enums.push_back(m_dataTypeString);
138 
139  m_dataTypeBool = new EnumType(6, "Bool", this);
140  m_enums.push_back(m_dataTypeBool);
141 
142  m_dataTypeColor = new EnumType(7, "Color", this);
143  m_enums.push_back(m_dataTypeColor);
144 
145  m_dataTypeGridSettings = new EnumType(8, "GridSettings", this);
146  m_enums.push_back(m_dataTypeGridSettings);
147 
148  m_dataTypeStringList = new EnumType(9, "StringList", this);
149  m_enums.push_back(m_dataTypeStringList);
150 
151  m_dataTypeFont = new EnumType(10, "Font", this);
152  m_enums.push_back(m_dataTypeFont);
153 
154  m_dataTypeImage = new EnumType(11, "Image", this);
155  m_enums.push_back(m_dataTypeImage);
156 
157  m_dataTypeTextGridSettings = new EnumType(12, "TextGridSettings", this);
158  m_enums.push_back(m_dataTypeTextGridSettings);
159 
160  m_dataTypeGroup = new EnumType(13, "Group", this);
161  m_enums.push_back(m_dataTypeGroup);
162 }
163 
165 {
166  return m_dataTypeNone;
167 }
168 
170 {
171  return m_dataTypeInt;
172 }
173 
175 {
176  return m_dataTypeDouble;
177 }
178 
180 {
181  return m_dataTypeLong;
182 }
183 
185 {
186  return m_dataTypeFloat;
187 }
188 
190 {
191  return m_dataTypeString;
192 }
193 
195 {
196  return m_dataTypeBool;
197 }
198 
200 {
201  return m_dataTypeColor;
202 }
203 
205 {
206  return m_dataTypeGridSettings;
207 }
208 
210 {
211  return m_dataTypeStringList;
212 }
213 
215 {
216  return m_dataTypeFont;
217 }
218 
220 {
221  return m_dataTypeImage;
222 }
223 
225 {
226  return m_dataTypeTextGridSettings;
227 }
228 
230 {
231  return m_dataTypeGroup;
232 }
233 
234 
235 
virtual EnumType * getDataTypeBool() const
Returns value that represents type bool belonging to enumeration.
EnumDataType()
Constructor.
virtual EnumType * getDataTypeDouble() const
Returns value that represents type double belonging to enumeration.
virtual EnumType * getDataTypeInt() const
Returns value that represents type integer belonging to enumeration.
virtual EnumType * getDataTypeNone() const
Returns value that represents type none belonging to enumeration.
virtual EnumType * getDataTypeGroup() const
Returns value that represents type Group (string) belonging to enumeration.
virtual void init()
Reimplemented from AbstractEnum.
virtual EnumType * getDataTypeGridSettings() const
Returns value that represents type GridSettings (string) belonging to enumeration.
virtual EnumType * getDataTypeFloat() const
Returns value that represents type float belonging to enumeration.
virtual EnumType * getDataTypeColor() const
Returns value that represents type te::color::RGBAColor** (color) belonging to enumeration.
virtual EnumType * getDataTypeTextGridSettings() const
Returns value that represents type TextGridSettings (string) belonging to enumeration.
Class to represent a data type enumeration. Ex.: int, double, bool, te::color::RGBAColor (color)...
virtual EnumType * getDataTypeLong() const
Returns value that represents type long belonging to enumeration.
Class that represents the value of an enumeration. An enumeration is made of "1..n" objects EnumType...
Definition: EnumType.h:48
virtual EnumType * getDataTypeFont() const
Returns value that represents type Font belonging to enumeration.
virtual EnumType * getDataTypeStringList() const
Returns value that represents type StringList (string) belonging to enumeration.
virtual EnumType * getDataTypeString() const
Returns value that represents type string belonging to enumeration.
virtual EnumType * getDataTypeImage() const
Returns value that represents type image (string) belonging to enumeration.
virtual ~EnumDataType()
Destructor.