rasdaman complete source
odmgtypes.hh
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 /
35 #ifndef _D_ODMGTYPES_
36 #define _D_ODMGTYPES_
37 
38 // for type-limits
39 #include <limits.h>
40 #include <float.h>
41 
42 //@Man: r_Char
43 //@Type: typedef
44 //@Args: as unsigned char (1 byte)
45 //@Memo: Module: {\bf rasodmg}.
46 
47 typedef unsigned char r_Char;
48 
55 //@Man: r_Octet
56 //@Type: typedef
57 //@Args: as signed char (1 byte)
58 //@Memo: Module: {\bf rasodmg}.
59 
60 typedef signed char r_Octet;
61 
69 //@Man: r_Short
70 //@Type: typedef
71 //@Args: as short (2 bytes)
72 //@Memo: Module: {\bf rasodmg}.
73 
74 typedef short r_Short;
75 
82 //@Man: r_UShort
83 //@Type: typedef
84 //@Args: as unsigned short (2 bytes)
85 //@Memo: Module: {\bf rasodmg}.
86 
87 typedef unsigned short r_UShort;
88 
95 //@Man: r_Long
96 //@Type: typedef
97 //@Args: as long (4 bytes)
98 //@Memo: Module: {\bf rasodmg}.
99 
100 typedef int r_Long;
109 //@Man: r_ULong
110 //@Type: typedef
111 //@Args: as unsigned long (4 bytes)
112 //@Memo: Module: {\bf rasodmg}.
113 
114 typedef unsigned int r_ULong;
120 //@Man: r_Float
121 //@Type: typedef
122 //@Args: as float
123 //@Memo: Module: {\bf rasodmg}.
124 
125 typedef float r_Float;
126 
133 //@Man: r_Double
134 //@Type: typedef
135 //@Args: as double
136 //@Memo: Module: {\bf rasodmg}.
137 
138 typedef double r_Double;
139 
146 //@Man: r_Boolean
147 //@Type: typedef
148 //@Args: as unsigned char (1 byte)
149 //@Memo: Module: {\bf rasodmg}.
150 
151 typedef unsigned char r_Boolean;
152 
159 //@Man: get_limits()
160 //@Type: function
161 //@Args: as function
162 //@Memo: Module: {\bf rasodmg}
163 
164 inline void get_limits( const r_Octet *tptr, double &min, double &max )
165 {
166  min = (double)SCHAR_MIN;
167  max = (double)SCHAR_MAX;
168 }
169 
170 inline void get_limits( const r_Char *tptr, double &min, double &max )
171 {
172  min = (double)0.0;
173  max = (double)UCHAR_MAX;
174 }
175 
176 inline void get_limits( const r_Short *tptr, double &min, double &max )
177 {
178  min = (double)SHRT_MIN;
179  max = (double)SHRT_MAX;
180 }
181 
182 inline void get_limits( const r_UShort *tptr, double &min, double &max )
183 {
184  min = (double)0.0;
185  max = (double)USHRT_MAX;
186 }
187 
188 inline void get_limits( const r_Long *tptr, double &min, double &max )
189 {
190  min = (double)INT_MIN;
191  max = (double)INT_MAX;
192 }
193 
194 inline void get_limits( const r_ULong *tptr, double &min, double &max )
195 {
196  min = (double)0.0;
197  max = (double)UINT_MAX;
198 }
199 
200 inline void get_limits( const r_Float *tptr, double &min, double &max )
201 {
202  min = -((double)FLT_MAX);
203  max = (double)FLT_MAX;
204 }
205 
206 inline void get_limits( const r_Double *tptr, double &min, double &max )
207 {
208  min = -((double)DBL_MAX);
209  max = (double)DBL_MAX;
210 }
211 
212 #endif