BooleanConverters.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/BooleanConverters.h
22 
23  \brief A set of function that convert an Boolean type to other types.
24 */
25 
26 #ifndef __TERRALIB_DATATYPE_INTERNAL_BOOLEANCONVERTERS_H
27 #define __TERRALIB_DATATYPE_INTERNAL_BOOLEANCONVERTERS_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 Boolean Methods
41  * Methods related to Boolean conversion.
42  */
43  //@{
44 
45  /*!
46  \brief It converts an Boolean 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 a Boolean type.
53  */
54  TEDATATYPEEXPORT AbstractData* BooleanToCharConverter(AbstractData* d) throw(Exception);
55 
56  /*!
57  \brief It converts an Boolean 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 a Boolean type.
64  */
65  TEDATATYPEEXPORT AbstractData* BooleanToUCharConverter(AbstractData* d) throw(Exception);
66 
67  /*!
68  \brief It converts an Boolean 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 a Boolean type.
75  */
76  TEDATATYPEEXPORT AbstractData* BooleanToInt16Converter(AbstractData* d) throw(Exception);
77 
78  /*!
79  \brief It converts an Boolean 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 a Boolean type.
86  */
87  TEDATATYPEEXPORT AbstractData* BooleanToUInt16Converter(AbstractData* d) throw(Exception);
88 
89  /*!
90  \brief It converts an Boolean data value to a Int32 data value.
91 
92  \param d The input data value.
93 
94  \return A new data value converted to 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 a Boolean type.
97  */
98  TEDATATYPEEXPORT AbstractData* BooleanToInt32Converter(AbstractData* d) throw(Exception);
99 
100  /*!
101  \brief It converts an Boolean data value to an unsigned Int32 data value.
102 
103  \param d The input data value.
104 
105  \return A new data value converted to unsigned Int32 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 a Boolean type.
108  */
109  TEDATATYPEEXPORT AbstractData* BooleanToUInt32Converter(AbstractData* d) throw(Exception);
110 
111  /*!
112  \brief It converts an Boolean data value to a Int64 data value.
113 
114  \param d The input data value.
115 
116  \return A new data value converted to 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 a Boolean type.
119  */
120  TEDATATYPEEXPORT AbstractData* BooleanToInt64Converter(AbstractData* d) throw(Exception);
121 
122  /*!
123  \brief It converts an Boolean data value to an unsigned Int64 data value.
124 
125  \param d The input data value.
126 
127  \return A new data value converted to unsigned Int64 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 a Boolean type.
130  */
131  TEDATATYPEEXPORT AbstractData* BooleanToUInt64Converter(AbstractData* d) throw(Exception);
132 
133  /*!
134  \brief It converts an Boolean data value to a float data 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 a Boolean type.
141  */
142  TEDATATYPEEXPORT AbstractData* BooleanToFloatConverter(AbstractData* d) throw(Exception);
143 
144  /*!
145  \brief It converts an Boolean data value to a double data 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 a Boolean type.
152  */
153  TEDATATYPEEXPORT AbstractData* BooleanToDoubleConverter(AbstractData* d) throw(Exception);
154 
155  /*!
156  \brief It converts an Boolean data value to a 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 a Boolean type.
163  */
164  TEDATATYPEEXPORT AbstractData* BooleanToNumericConverter(AbstractData* d) throw(Exception);
165 
166  /*!
167  \brief It converts an Boolean 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 a Boolean type.
174  */
175  TEDATATYPEEXPORT AbstractData* BooleanToStringConverter(AbstractData* d) throw(Exception);
176 
177  /*!
178  \brief Auxiliary method that asserts that the given data is an Boolean type.
179 
180  \param d The input data value.
181 
182  \exception Exception It throws an exception if the input abstract data is not a Boolean type.
183  */
184  TEDATATYPEEXPORT void AssertBoolean(AbstractData* d) throw(Exception);
185 
186  //@}
187 
188  } // end namespace dt
189 } // end namespace te
190 
191 #endif // __TERRALIB_DATATYPE_INTERNAL_BOOLEANCONVERTERS_H
An exception class for the DataType module.
TEDATATYPEEXPORT AbstractData * BooleanToFloatConverter(AbstractData *d)
It converts an Boolean data value to a float data value.
TEDATATYPEEXPORT AbstractData * BooleanToUCharConverter(AbstractData *d)
It converts an Boolean data value to an unsigned char data value.
TEDATATYPEEXPORT AbstractData * BooleanToNumericConverter(AbstractData *d)
It converts an Boolean data value to a Numeric data value.
#define TEDATATYPEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
Configuration flags for the DataType module of TerraLib.
URI C++ Library.
TEDATATYPEEXPORT AbstractData * BooleanToDoubleConverter(AbstractData *d)
It converts an Boolean data value to a double data value.
TEDATATYPEEXPORT AbstractData * BooleanToUInt64Converter(AbstractData *d)
It converts an Boolean data value to an unsigned Int64 data value.
TEDATATYPEEXPORT void AssertBoolean(AbstractData *d)
Auxiliary method that asserts that the given data is an Boolean type.
TEDATATYPEEXPORT AbstractData * BooleanToUInt16Converter(AbstractData *d)
It converts an Boolean data value to an unsigned Int16 data value.
TEDATATYPEEXPORT AbstractData * BooleanToStringConverter(AbstractData *d)
It converts an Boolean data value to a string data value.
TEDATATYPEEXPORT AbstractData * BooleanToUInt32Converter(AbstractData *d)
It converts an Boolean data value to an unsigned Int32 data value.
TEDATATYPEEXPORT AbstractData * BooleanToInt32Converter(AbstractData *d)
It converts an Boolean data value to a Int32 data value.
TEDATATYPEEXPORT AbstractData * BooleanToInt64Converter(AbstractData *d)
It converts an Boolean data value to a Int64 data value.
TEDATATYPEEXPORT AbstractData * BooleanToCharConverter(AbstractData *d)
It converts an Boolean data value to a char data value.
TEDATATYPEEXPORT AbstractData * BooleanToInt16Converter(AbstractData *d)
It converts an Boolean data value to a Int16 data value.