IntegerConverters.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/IntegerConverters.h
22 
23  \brief A set of function that convert an Integer type to other types.
24 */
25 
26 #ifndef __TERRALIB_DATATYPE_INTERNAL_INTEGERCONVERTERS_H
27 #define __TERRALIB_DATATYPE_INTERNAL_INTEGERCONVERTERS_H
28 
29 // TerraLib
30 #include "Exception.h"
31 #include "Config.h"
32 
33 namespace te
34 {
35  namespace dt
36  {
37 // Forward declarations
38  class AbstractData;
39 
40  /** @name Int32 Methods
41  * Methods related to Int32 conversion.
42  */
43  //@{
44 
45  /*!
46  \brief It converts an Int32 data value to a char data value.
47 
48  \param d The input data value.
49 
50  \return A new data value converted to char data type. The caller will take the ownership of the returned data.
51 
52  \exception Exception It throws an exception if the input abstract data is not an Int32 type.
53  */
55 
56  /*!
57  \brief It converts an Int32 data value to an unsigned char data value.
58 
59  \param d The input data value.
60 
61  \return A new data value converted to unsigned char data type. The caller will take the ownership of the returned data.
62 
63  \exception Exception It throws an exception if the input abstract data is not an Int32 type.
64  */
66 
67  /*!
68  \brief It converts an Int32 data value to a Int16 data value.
69 
70  \param d The input data value.
71 
72  \return A new data value converted to Int16 data type. The caller will take the ownership of the returned data.
73 
74  \exception Exception It throws an exception if the input abstract data is not an Int32 type.
75  */
77 
78  /*!
79  \brief It converts an Int32 data value to an unsigned Int16 data value.
80 
81  \param d The input data value.
82 
83  \return A new data value converted to unsigned Int16 data type. The caller will take the ownership of the returned data.
84 
85  \exception Exception It throws an exception if the input abstract data is not an Int32 type.
86  */
88 
89  /*!
90  \brief It converts an Int32 data value to an unsigned Int32 data value.
91 
92  \param d The input data value.
93 
94  \return A new data value converted to unsigned Int32 data type. The caller will take the ownership of the returned data.
95 
96  \exception Exception It throws an exception if the input abstract data is not an Int32 type.
97  */
99 
100  /*!
101  \brief It converts an Int32 data value to a Int64 data value.
102 
103  \param d The input data value.
104 
105  \return A new data value converted to Int64 data type. The caller will take the ownership of the returned data.
106 
107  \exception Exception It throws an exception if the input abstract data is not an Int32 type.
108  */
110 
111  /*!
112  \brief It converts an Int32 data value to an unsigned Int64 data value.
113 
114  \param d The input data value.
115 
116  \return A new data value converted to unsigned Int64 data type. The caller will take the ownership of the returned data.
117 
118  \exception Exception It throws an exception if the input abstract data is not an Int32 type.
119  */
121 
122  /*!
123  \brief It converts an Int32 data value to a boolean data value.
124 
125  \param d The input data value.
126 
127  \return A new data value converted to boolean data type. The caller will take the ownership of the returned data.
128 
129  \exception Exception It throws an exception if the input abstract data is not an Int32 type.
130  */
132 
133  /*!
134  \brief It converts an Int32 data value to a float value.
135 
136  \param d The input data value.
137 
138  \return A new data value converted to float data type. The caller will take the ownership of the returned data.
139 
140  \exception Exception It throws an exception if the input abstract data is not an Int32 type.
141  */
143 
144  /*!
145  \brief It converts an Int32 data value to a double value.
146 
147  \param d The input data value.
148 
149  \return A new data value converted to double data type. The caller will take the ownership of the returned data.
150 
151  \exception Exception It throws an exception if the input abstract data is not an Int32 type.
152  */
154 
155  /*!
156  \brief It converts an Int32 data value to Numeric data value.
157 
158  \param d The input data value.
159 
160  \return A new data value converted to Numeric data type. The caller will take the ownership of the returned data.
161 
162  \exception Exception It throws an exception if the input abstract data is not an Int32 type.
163  */
165 
166  /*!
167  \brief It converts an Int32 data value to a string data value.
168 
169  \param d The input data value.
170 
171  \return A new data value converted to string data type. The caller will take the ownership of the returned data.
172 
173  \exception Exception It throws an exception if the input abstract data is not an Int32 type.
174  */
176 
177  /*!
178  \brief Auxiliary method that asserts that the given data is an Int32 type.
179 
180  \param d The input data value.
181 
182  \exception Exception It throws an exception if the input abstract data is not an Int32 type.
183  */
185 
186  //@}
187 
188  /** @name UInt32 Methods
189  * Methods related to unsigned Int32 conversion.
190  */
191  //@{
192 
193  /*!
194  \brief It converts an unsigned Int32 data value to a char data value.
195 
196  \param d The input data value.
197 
198  \return A new data value converted to char data type. The caller will take the ownership of the returned data.
199 
200  \exception Exception It throws an exception if the input abstract data is not an unsigned Int32 type.
201  */
203 
204  /*!
205  \brief It converts an unsigned Int32 data value to an unsigned char data value.
206 
207  \param d The input data value.
208 
209  \return A new data value converted to unsigned char data type. The caller will take the ownership of the returned data.
210 
211  \exception Exception It throws an exception if the input abstract data is not an unsigned Int32 type.
212  */
214 
215  /*!
216  \brief It converts an unsigned Int32 data value to a Int16 data value.
217 
218  \param d The input data value.
219 
220  \return A new data value converted to Int16 data type. The caller will take the ownership of the returned data.
221 
222  \exception Exception It throws an exception if the input abstract data is not an unsigned Int32 type.
223  */
225 
226  /*!
227  \brief It converts an unsigned Int32 data value to an unsigned Int16 data value.
228 
229  \param d The input data value.
230 
231  \return A new data value converted to unsigned Int16 data type. The caller will take the ownership of the returned data.
232 
233  \exception Exception It throws an exception if the input abstract data is not an unsigned Int32 type.
234  */
236 
237  /*!
238  \brief It converts an unsigned Int32 data value to an Int32 data value.
239 
240  \param d The input data value.
241 
242  \return A new data value converted to Int32 data type. The caller will take the ownership of the returned data.
243 
244  \exception Exception It throws an exception if the input abstract data is not an unsigned Int32 type.
245  */
247 
248  /*!
249  \brief It converts an unsigned Int32 data value to a Int64 data value.
250 
251  \param d The input data value.
252 
253  \return A new data value converted to Int64 data type. The caller will take the ownership of the returned data.
254 
255  \exception Exception It throws an exception if the input abstract data is not an unsigned Int32 type.
256  */
258 
259  /*!
260  \brief It converts an unsigned Int32 data value to an unsigned Int64 data value.
261 
262  \param d The input data value.
263 
264  \return A new data value converted to unsigned Int64 data type. The caller will take the ownership of the returned data.
265 
266  \exception Exception It throws an exception if the input abstract data is not an unsigned Int32 type.
267  */
269 
270  /*!
271  \brief It converts an unsigned Int32 data value to a boolean data value.
272 
273  \param d The input data value.
274 
275  \return A new data value converted to boolean data type. The caller will take the ownership of the returned data.
276 
277  \exception Exception It throws an exception if the input abstract data is not an unsigned Int32 type.
278  */
280 
281  /*!
282  \brief It converts an unsigned Int32 data value to a float value.
283 
284  \param d The input data value.
285 
286  \return A new data value converted to float data type. The caller will take the ownership of the returned data.
287 
288  \exception Exception It throws an exception if the input abstract data is not an unsigned Int32 type.
289  */
291 
292  /*!
293  \brief It converts an unsigned Int32 data value to a double value.
294 
295  \param d The input data value.
296 
297  \return A new data value converted to double data type. The caller will take the ownership of the returned data.
298 
299  \exception Exception It throws an exception if the input abstract data is not an unsigned Int32 type.
300  */
302 
303  /*!
304  \brief It converts an unsigned Int32 data value to Numeric data value.
305 
306  \param d The input data value.
307 
308  \return A new data value converted to Numeric data type. The caller will take the ownership of the returned data.
309 
310  \exception Exception It throws an exception if the input abstract data is not an unsigned Int32 type.
311  */
313 
314  /*!
315  \brief It converts an unsigned Int32 data value to a string data value.
316 
317  \param d The input data value.
318 
319  \return A new data value converted to string data type. The caller will take the ownership of the returned data.
320 
321  \exception Exception It throws an exception if the input abstract data is not an unsigned Int32 type.
322  */
324 
325  /*!
326  \brief Auxiliary method that asserts that the given data is an unsigned Int32 type.
327 
328  \param d The input data value.
329 
330  \exception Exception It throws an exception if the input abstract data is not an unsigned Int32 type.
331  */
333 
334  //@}
335 
336  } // end namespace dt
337 } // end namespace te
338 
339 #endif // __TERRALIB_DATATYPE_INTERNAL_INTEGERCONVERTERS_H
te::dt::UInt32ToNumericConverter
TEDATATYPEEXPORT AbstractData * UInt32ToNumericConverter(AbstractData *d)
It converts an unsigned Int32 data value to Numeric data value.
te::dt::Int32ToUCharConverter
TEDATATYPEEXPORT AbstractData * Int32ToUCharConverter(AbstractData *d)
It converts an Int32 data value to an unsigned char data value.
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::dt::UInt32ToInt16Converter
TEDATATYPEEXPORT AbstractData * UInt32ToInt16Converter(AbstractData *d)
It converts an unsigned Int32 data value to a Int16 data value.
te::dt::AssertInt32
TEDATATYPEEXPORT void AssertInt32(AbstractData *d)
Auxiliary method that asserts that the given data is an Int32 type.
te::dt::Int32ToDoubleConverter
TEDATATYPEEXPORT AbstractData * Int32ToDoubleConverter(AbstractData *d)
It converts an Int32 data value to a double value.
te::dt::UInt32ToInt64Converter
TEDATATYPEEXPORT AbstractData * UInt32ToInt64Converter(AbstractData *d)
It converts an unsigned Int32 data value to a Int64 data value.
te::dt::UInt32ToCharConverter
TEDATATYPEEXPORT AbstractData * UInt32ToCharConverter(AbstractData *d)
It converts an unsigned Int32 data value to a char data value.
te::dt::Int32ToFloatConverter
TEDATATYPEEXPORT AbstractData * Int32ToFloatConverter(AbstractData *d)
It converts an Int32 data value to a float value.
te::dt::Int32ToInt64Converter
TEDATATYPEEXPORT AbstractData * Int32ToInt64Converter(AbstractData *d)
It converts an Int32 data value to a Int64 data value.
te::dt::UInt32ToUCharConverter
TEDATATYPEEXPORT AbstractData * UInt32ToUCharConverter(AbstractData *d)
It converts an unsigned Int32 data value to an unsigned char data value.
te::dt::Int32ToUInt16Converter
TEDATATYPEEXPORT AbstractData * Int32ToUInt16Converter(AbstractData *d)
It converts an Int32 data value to an unsigned Int16 data value.
te::dt::UInt32ToDoubleConverter
TEDATATYPEEXPORT AbstractData * UInt32ToDoubleConverter(AbstractData *d)
It converts an unsigned Int32 data value to a double value.
te::dt::Int32ToBooleanConverter
TEDATATYPEEXPORT AbstractData * Int32ToBooleanConverter(AbstractData *d)
It converts an Int32 data value to a boolean data value.
te::dt::AssertUInt32
TEDATATYPEEXPORT void AssertUInt32(AbstractData *d)
Auxiliary method that asserts that the given data is an unsigned Int32 type.
te::dt::UInt32ToUInt64Converter
TEDATATYPEEXPORT AbstractData * UInt32ToUInt64Converter(AbstractData *d)
It converts an unsigned Int32 data value to an unsigned Int64 data value.
Exception.h
An exception class for the XML module.
te::dt::Int32ToUInt32Converter
TEDATATYPEEXPORT AbstractData * Int32ToUInt32Converter(AbstractData *d)
It converts an Int32 data value to an unsigned Int32 data value.
te::Exception
Base exception class for plugin module.
Definition: Exception.h:42
te::dt::UInt32ToFloatConverter
TEDATATYPEEXPORT AbstractData * UInt32ToFloatConverter(AbstractData *d)
It converts an unsigned Int32 data value to a float value.
te::dt::Int32ToCharConverter
TEDATATYPEEXPORT AbstractData * Int32ToCharConverter(AbstractData *d)
It converts an Int32 data value to a char data value.
te::dt::UInt32ToUInt16Converter
TEDATATYPEEXPORT AbstractData * UInt32ToUInt16Converter(AbstractData *d)
It converts an unsigned Int32 data value to an unsigned Int16 data value.
te::dt::Int32ToNumericConverter
TEDATATYPEEXPORT AbstractData * Int32ToNumericConverter(AbstractData *d)
It converts an Int32 data value to Numeric data value.
te::dt::Int32ToInt16Converter
TEDATATYPEEXPORT AbstractData * Int32ToInt16Converter(AbstractData *d)
It converts an Int32 data value to a Int16 data value.
te::dt::AbstractData
A base class for values that can be retrieved from the data access module.
Definition: AbstractData.h:56
te::dt::Int32ToStringConverter
TEDATATYPEEXPORT AbstractData * Int32ToStringConverter(AbstractData *d)
It converts an Int32 data value to a string data value.
te::dt::UInt32ToBooleanConverter
TEDATATYPEEXPORT AbstractData * UInt32ToBooleanConverter(AbstractData *d)
It converts an unsigned Int32 data value to a boolean data value.
te::dt::UInt32ToInt32Converter
TEDATATYPEEXPORT AbstractData * UInt32ToInt32Converter(AbstractData *d)
It converts an unsigned Int32 data value to an Int32 data value.
TEDATATYPEEXPORT
#define TEDATATYPEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
Config.h
Proxy configuration file for TerraView (see terraview_config.h).
te::dt::Int32ToUInt64Converter
TEDATATYPEEXPORT AbstractData * Int32ToUInt64Converter(AbstractData *d)
It converts an Int32 data value to an unsigned Int64 data value.
te::dt::UInt32ToStringConverter
TEDATATYPEEXPORT AbstractData * UInt32ToStringConverter(AbstractData *d)
It converts an unsigned Int32 data value to a string data value.