-
Notifications
You must be signed in to change notification settings - Fork 494
Expand file tree
/
Copy pathArrowTypes.h
More file actions
85 lines (82 loc) · 2.11 KB
/
ArrowTypes.h
File metadata and controls
85 lines (82 loc) · 2.11 KB
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
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#ifndef O2_FRAMEWORK_ARROWTYPES_H
#define O2_FRAMEWORK_ARROWTYPES_H
#include "arrow/type_fwd.h"
namespace o2::soa
{
template <typename T>
struct arrow_array_for {
};
template <>
struct arrow_array_for<bool> {
using type = arrow::BooleanArray;
};
template <>
struct arrow_array_for<int8_t> {
using type = arrow::Int8Array;
};
template <>
struct arrow_array_for<uint8_t> {
using type = arrow::UInt8Array;
};
template <>
struct arrow_array_for<int16_t> {
using type = arrow::Int16Array;
};
template <>
struct arrow_array_for<uint16_t> {
using type = arrow::UInt16Array;
};
template <>
struct arrow_array_for<int32_t> {
using type = arrow::Int32Array;
};
template <>
struct arrow_array_for<int64_t> {
using type = arrow::Int64Array;
};
template <>
struct arrow_array_for<uint32_t> {
using type = arrow::UInt32Array;
};
template <>
struct arrow_array_for<uint64_t> {
using type = arrow::UInt64Array;
};
template <>
struct arrow_array_for<float> {
using type = arrow::FloatArray;
};
template <>
struct arrow_array_for<double> {
using type = arrow::DoubleArray;
};
template <int N>
struct arrow_array_for<float[N]> {
using type = arrow::FixedSizeListArray;
using value_type = float;
};
template <int N>
struct arrow_array_for<int[N]> {
using type = arrow::FixedSizeListArray;
using value_type = int;
};
template <int N>
struct arrow_array_for<double[N]> {
using type = arrow::FixedSizeListArray;
using value_type = double;
};
template <typename T>
using arrow_array_for_t = typename arrow_array_for<T>::type;
template <typename T>
using value_for_t = typename arrow_array_for<T>::value_type;
} // namespace o2::soa
#endif // O2_FRAMEWORK_ARROWTYPES_H