rasdaman client API 10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
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 /
18rasdaman GmbH.
19*
20* For more information please see <http://www.rasdaman.org>
21* or contact Peter Baumann via <baumann@rasdaman.com>.
22*/
23
24#ifndef D_ODMGTYPES_HH
25#define D_ODMGTYPES_HH
26
27// for type-limits
28#include <limits.h>
29#include <float.h>
30#include <cstdint>
31
32using r_Boolean = std::uint8_t;
33using r_Char = std::uint8_t;
34using r_Octet = std::int8_t;
35using r_UShort = std::uint16_t;
36using r_Short = std::int16_t;
37using r_Long = std::int32_t;
38using r_ULong = std::uint32_t;
39using r_Float = float;
40using r_Double = double;
41
42inline void get_limits_octet(double &min, double &max)
43{
44 min = static_cast<double>(SCHAR_MIN);
45 max = static_cast<double>(SCHAR_MAX);
46}
47inline void get_limits_char(double &min, double &max)
48{
49 min = 0.0;
50 max = static_cast<double>(UCHAR_MAX);
51}
52
53inline void get_limits_short(double &min, double &max)
54{
55 min = static_cast<double>(SHRT_MIN);
56 max = static_cast<double>(SHRT_MAX);
57}
58
59inline void get_limits_Ushort(double &min, double &max)
60{
61 min = 0.0;
62 max = static_cast<double>(USHRT_MAX);
63}
64
65inline void get_limits_long(double &min, double &max)
66{
67 min = static_cast<double>(INT_MIN);
68 max = static_cast<double>(INT_MAX);
69}
70
71inline void get_limits_Ulong(double &min, double &max)
72{
73 min = 0.0;
74 max = static_cast<double>(UINT_MAX);
75}
76
77inline void get_limits_float(double &min, double &max)
78{
79 min = -static_cast<double>(FLT_MAX);
80 max = static_cast<double>(FLT_MAX);
81}
82
83inline void get_limits_double(double &min, double &max)
84{
85 min = -DBL_MAX;
86 max = DBL_MAX;
87}
88
89#endif
void get_limits_long(double &min, double &max)
Definition odmgtypes.hh:65
void get_limits_char(double &min, double &max)
Definition odmgtypes.hh:47
std::uint32_t r_ULong
Definition odmgtypes.hh:38
double r_Double
Definition odmgtypes.hh:40
void get_limits_float(double &min, double &max)
Definition odmgtypes.hh:77
std::uint16_t r_UShort
Definition odmgtypes.hh:35
float r_Float
Definition odmgtypes.hh:39
std::int8_t r_Octet
Definition odmgtypes.hh:34
void get_limits_short(double &min, double &max)
Definition odmgtypes.hh:53
std::uint8_t r_Char
Definition odmgtypes.hh:33
void get_limits_Ushort(double &min, double &max)
Definition odmgtypes.hh:59
std::int32_t r_Long
Definition odmgtypes.hh:37
std::uint8_t r_Boolean
Definition odmgtypes.hh:32
void get_limits_octet(double &min, double &max)
Definition odmgtypes.hh:42
std::int16_t r_Short
Definition odmgtypes.hh:36
void get_limits_Ulong(double &min, double &max)
Definition odmgtypes.hh:71
void get_limits_double(double &min, double &max)
Definition odmgtypes.hh:83