summaryrefslogtreecommitdiffstats
path: root/raslib/odmgtypes.hh
blob: 21354e9c4b5ebbd9d89dc61d0e2fa69d79f84aca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
/*
* This file is part of rasdaman community.
*
* Rasdaman community is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Rasdaman community is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with rasdaman community.  If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
rasdaman GmbH.
*
* For more information please see <http://www.rasdaman.org>
* or contact Peter Baumann via <baumann@rasdaman.com>.
/
/**
 * INCLUDE: odmgtypes.hh
 *
 * MODULE:  rasodmg
 *
 * PURPOSE:
 * 		The file contains ODMG type definitions.
 *
 * COMMENTS:
 *  For further porting please adapt the typedef for r_Long and r_Ulong
*/

#ifndef _D_ODMGTYPES_
#define _D_ODMGTYPES_

// for type-limits
#include <limits.h>
#include <float.h>

//@Man: r_Char
//@Type: typedef
//@Args: as unsigned char (1 byte)
//@Memo: Module: {\bf rasodmg}.

typedef unsigned char r_Char;

/**
  {\tt typedef unsigned char r_Char;}
*/



//@Man: r_Octet
//@Type: typedef
//@Args: as signed char (1 byte)
//@Memo: Module: {\bf rasodmg}.

typedef signed char r_Octet;

/**
  {\tt typedef signed char r_Octet;}
  (Stroustroup: sign of plain char is implementation-defined)
*/



//@Man: r_Short
//@Type: typedef
//@Args: as short (2 bytes)
//@Memo: Module: {\bf rasodmg}.

typedef short r_Short;

/**
  {\tt typedef short r_Short;}
*/



//@Man: r_UShort
//@Type: typedef
//@Args: as unsigned short (2 bytes)
//@Memo: Module: {\bf rasodmg}.

typedef unsigned short r_UShort;

/**
  {\tt typedef short r_UShort;}
*/



//@Man: r_Long
//@Type: typedef
//@Args: as long (4 bytes)
//@Memo: Module: {\bf rasodmg}.

typedef int r_Long; 
/**
  {\tt typedef int r_Long;}
*/





//@Man: r_ULong
//@Type: typedef
//@Args: as unsigned long (4 bytes)
//@Memo: Module: {\bf rasodmg}.

typedef unsigned int r_ULong; 
/**
  {\tt typedef unsigned long r_ULong;}
*/


//@Man: r_Float
//@Type: typedef
//@Args: as float
//@Memo: Module: {\bf rasodmg}.

typedef float r_Float;

/**
  {\tt typedef float r_Float;}
*/



//@Man: r_Double
//@Type: typedef
//@Args: as double
//@Memo: Module: {\bf rasodmg}.

typedef double r_Double;

/**
  {\tt typedef double r_Double;}
*/



//@Man: r_Boolean
//@Type: typedef
//@Args: as unsigned char (1 byte)
//@Memo: Module: {\bf rasodmg}.

typedef unsigned char r_Boolean;

/**
  {\tt typedef unsigned char r_Boolean;}
  Changed to unsigned char
*/


//@Man: get_limits()
//@Type: function
//@Args: as function
//@Memo: Module: {\bf rasodmg}

inline void get_limits( const r_Octet *tptr, double &min, double &max )
{
  min = (double)SCHAR_MIN; max = (double)SCHAR_MAX;
}

inline void get_limits( const r_Char *tptr, double &min, double &max )
{
  min = (double)0.0; max = (double)UCHAR_MAX;
}

inline void get_limits( const r_Short *tptr, double &min, double &max )
{
  min = (double)SHRT_MIN; max = (double)SHRT_MAX;
}

inline void get_limits( const r_UShort *tptr, double &min, double &max )
{
  min = (double)0.0; max = (double)USHRT_MAX;
}

inline void get_limits( const r_Long *tptr, double &min, double &max )
{
  min = (double)INT_MIN; max = (double)INT_MAX;
}

inline void get_limits( const r_ULong *tptr, double &min, double &max )
{
  min = (double)0.0; max = (double)UINT_MAX;
}

inline void get_limits( const r_Float *tptr, double &min, double &max )
{
  min = -((double)FLT_MAX); max = (double)FLT_MAX;
}

inline void get_limits( const r_Double *tptr, double &min, double &max )
{
  min = -((double)DBL_MAX); max = (double)DBL_MAX;
}

#endif