1 | // Licensed to the Apache Software Foundation (ASF) under one |
---|---|
2 | // or more contributor license agreements. See the NOTICE file |
3 | // distributed with this work for additional information |
4 | // regarding copyright ownership. The ASF licenses this file |
5 | // to you under the Apache License, Version 2.0 (the |
6 | // "License"); you may not use this file except in compliance |
7 | // with the License. You may obtain a copy of the License at |
8 | // |
9 | // http://www.apache.org/licenses/LICENSE-2.0 |
10 | // |
11 | // Unless required by applicable law or agreed to in writing, |
12 | // software distributed under the License is distributed on an |
13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14 | // KIND, either express or implied. See the License for the |
15 | // specific language governing permissions and limitations |
16 | // under the License. |
17 | |
18 | #ifndef ARROW_TYPE_FWD_H |
19 | #define ARROW_TYPE_FWD_H |
20 | |
21 | #include <memory> |
22 | |
23 | #include "arrow/util/visibility.h" |
24 | |
25 | namespace arrow { |
26 | |
27 | class Status; |
28 | |
29 | class DataType; |
30 | class Array; |
31 | struct ArrayData; |
32 | class ArrayBuilder; |
33 | class Field; |
34 | class Tensor; |
35 | |
36 | class ChunkedArray; |
37 | class Column; |
38 | class RecordBatch; |
39 | class Table; |
40 | |
41 | class Buffer; |
42 | class MemoryPool; |
43 | class RecordBatch; |
44 | class Schema; |
45 | |
46 | class DictionaryType; |
47 | class DictionaryArray; |
48 | |
49 | class NullType; |
50 | class NullArray; |
51 | class NullBuilder; |
52 | |
53 | class BooleanType; |
54 | class BooleanArray; |
55 | class BooleanBuilder; |
56 | |
57 | class BinaryType; |
58 | class BinaryArray; |
59 | class BinaryBuilder; |
60 | |
61 | class FixedSizeBinaryType; |
62 | class FixedSizeBinaryArray; |
63 | class FixedSizeBinaryBuilder; |
64 | |
65 | class StringType; |
66 | class StringArray; |
67 | class StringBuilder; |
68 | |
69 | class ListType; |
70 | class ListArray; |
71 | class ListBuilder; |
72 | |
73 | class StructType; |
74 | class StructArray; |
75 | class StructBuilder; |
76 | |
77 | class Decimal128Type; |
78 | class Decimal128Array; |
79 | class Decimal128Builder; |
80 | |
81 | class UnionType; |
82 | class UnionArray; |
83 | |
84 | template <typename TypeClass> |
85 | class NumericArray; |
86 | |
87 | template <typename TypeClass> |
88 | class NumericBuilder; |
89 | |
90 | template <typename TypeClass> |
91 | class NumericTensor; |
92 | |
93 | #define _NUMERIC_TYPE_DECL(KLASS) \ |
94 | class KLASS##Type; \ |
95 | using KLASS##Array = NumericArray<KLASS##Type>; \ |
96 | using KLASS##Builder = NumericBuilder<KLASS##Type>; \ |
97 | using KLASS##Tensor = NumericTensor<KLASS##Type>; |
98 | |
99 | _NUMERIC_TYPE_DECL(Int8) |
100 | _NUMERIC_TYPE_DECL(Int16) |
101 | _NUMERIC_TYPE_DECL(Int32) |
102 | _NUMERIC_TYPE_DECL(Int64) |
103 | _NUMERIC_TYPE_DECL(UInt8) |
104 | _NUMERIC_TYPE_DECL(UInt16) |
105 | _NUMERIC_TYPE_DECL(UInt32) |
106 | _NUMERIC_TYPE_DECL(UInt64) |
107 | _NUMERIC_TYPE_DECL(HalfFloat) |
108 | _NUMERIC_TYPE_DECL(Float) |
109 | _NUMERIC_TYPE_DECL(Double) |
110 | |
111 | #undef _NUMERIC_TYPE_DECL |
112 | |
113 | class Date64Type; |
114 | using Date64Array = NumericArray<Date64Type>; |
115 | using Date64Builder = NumericBuilder<Date64Type>; |
116 | |
117 | class Date32Type; |
118 | using Date32Array = NumericArray<Date32Type>; |
119 | using Date32Builder = NumericBuilder<Date32Type>; |
120 | |
121 | class Time32Type; |
122 | using Time32Array = NumericArray<Time32Type>; |
123 | using Time32Builder = NumericBuilder<Time32Type>; |
124 | |
125 | class Time64Type; |
126 | using Time64Array = NumericArray<Time64Type>; |
127 | using Time64Builder = NumericBuilder<Time64Type>; |
128 | |
129 | class TimestampType; |
130 | using TimestampArray = NumericArray<TimestampType>; |
131 | using TimestampBuilder = NumericBuilder<TimestampType>; |
132 | |
133 | class IntervalType; |
134 | using IntervalArray = NumericArray<IntervalType>; |
135 | |
136 | // ---------------------------------------------------------------------- |
137 | // (parameter-free) Factory functions |
138 | // Other factory functions are in type.h |
139 | |
140 | /// \defgroup type-factories Factory functions for creating data types |
141 | /// |
142 | /// Factory functions for creating data types |
143 | /// @{ |
144 | |
145 | /// \brief Return a NullType instance |
146 | std::shared_ptr<DataType> ARROW_EXPORT null(); |
147 | /// \brief Return a BooleanType instance |
148 | std::shared_ptr<DataType> ARROW_EXPORT boolean(); |
149 | /// \brief Return a Int8Type instance |
150 | std::shared_ptr<DataType> ARROW_EXPORT int8(); |
151 | /// \brief Return a Int16Type instance |
152 | std::shared_ptr<DataType> ARROW_EXPORT int16(); |
153 | /// \brief Return a Int32Type instance |
154 | std::shared_ptr<DataType> ARROW_EXPORT int32(); |
155 | /// \brief Return a Int64Type instance |
156 | std::shared_ptr<DataType> ARROW_EXPORT int64(); |
157 | /// \brief Return a UInt8Type instance |
158 | std::shared_ptr<DataType> ARROW_EXPORT uint8(); |
159 | /// \brief Return a UInt16Type instance |
160 | std::shared_ptr<DataType> ARROW_EXPORT uint16(); |
161 | /// \brief Return a UInt32Type instance |
162 | std::shared_ptr<DataType> ARROW_EXPORT uint32(); |
163 | /// \brief Return a UInt64Type instance |
164 | std::shared_ptr<DataType> ARROW_EXPORT uint64(); |
165 | /// \brief Return a HalfFloatType instance |
166 | std::shared_ptr<DataType> ARROW_EXPORT float16(); |
167 | /// \brief Return a FloatType instance |
168 | std::shared_ptr<DataType> ARROW_EXPORT float32(); |
169 | /// \brief Return a DoubleType instance |
170 | std::shared_ptr<DataType> ARROW_EXPORT float64(); |
171 | /// \brief Return a StringType instance |
172 | std::shared_ptr<DataType> ARROW_EXPORT utf8(); |
173 | /// \brief Return a BinaryType instance |
174 | std::shared_ptr<DataType> ARROW_EXPORT binary(); |
175 | /// \brief Return a Date32Type instance |
176 | std::shared_ptr<DataType> ARROW_EXPORT date32(); |
177 | /// \brief Return a Date64Type instance |
178 | std::shared_ptr<DataType> ARROW_EXPORT date64(); |
179 | |
180 | /// @} |
181 | |
182 | } // namespace arrow |
183 | |
184 | #endif // ARROW_TYPE_FWD_H |
185 |