OmniSciDB
bf83d84833
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
DatumFetchers.h
Go to the documentation of this file.
1
/*
2
* Copyright 2019 OmniSci, Inc.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#pragma once
18
19
#include "
sqltypes.h
"
20
21
namespace
DatumFetcher {
22
23
template
<
typename
T>
24
inline
T
getDatumVal
(
const
Datum
& d);
25
26
template
<>
27
inline
int8_t
getDatumVal
(
const
Datum
& d) {
28
return
d.
tinyintval
;
29
}
30
31
template
<>
32
inline
int16_t
getDatumVal
(
const
Datum
& d) {
33
return
d.
smallintval
;
34
}
35
36
template
<>
37
inline
int32_t
getDatumVal
(
const
Datum
& d) {
38
return
d.
intval
;
39
}
40
41
template
<>
42
inline
int64_t
getDatumVal
(
const
Datum
& d) {
43
return
d.
bigintval
;
44
}
45
46
template
<>
47
inline
uint8_t
getDatumVal
(
const
Datum
& d) {
48
return
d.
tinyintval
;
49
}
50
51
template
<>
52
inline
uint16_t
getDatumVal
(
const
Datum
& d) {
53
return
d.
smallintval
;
54
}
55
56
template
<>
57
inline
float
getDatumVal
(
const
Datum
& d) {
58
return
d.
floatval
;
59
}
60
61
template
<>
62
inline
double
getDatumVal
(
const
Datum
& d) {
63
return
d.
doubleval
;
64
}
65
66
}
// namespace DatumFetcher
Datum::tinyintval
int8_t tinyintval
Definition:
sqltypes.h:203
sqltypes.h
Constants for Builtin SQL Types supported by OmniSci.
Datum::intval
int32_t intval
Definition:
sqltypes.h:205
DatumFetcher::getDatumVal
T getDatumVal(const Datum &d)
Definition:
DatumFetchers.h:27
Datum::floatval
float floatval
Definition:
sqltypes.h:207
Datum::bigintval
int64_t bigintval
Definition:
sqltypes.h:206
Datum::smallintval
int16_t smallintval
Definition:
sqltypes.h:204
Datum
Definition:
sqltypes.h:201
omnisci.dtypes.T
T
Definition:
dtypes.py:8
Datum::doubleval
double doubleval
Definition:
sqltypes.h:208
Shared
DatumFetchers.h
Generated on Tue Jan 12 2021 18:25:53 for OmniSciDB by
1.8.5