Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
visitor_inline.h
Go to the documentation of this file.
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 // Private header, not to be exported
19 
20 #ifndef ARROW_VISITOR_INLINE_H
21 #define ARROW_VISITOR_INLINE_H
22 
23 #include "arrow/array.h"
24 #include "arrow/status.h"
25 #include "arrow/tensor.h"
26 #include "arrow/type.h"
28 
29 namespace arrow {
30 
31 #define TYPE_VISIT_INLINE(TYPE_CLASS) \
32  case TYPE_CLASS::type_id: \
33  return visitor->Visit(internal::checked_cast<const TYPE_CLASS&>(type));
34 
35 template <typename VISITOR>
36 inline Status VisitTypeInline(const DataType& type, VISITOR* visitor) {
37  switch (type.id()) {
64  default:
65  break;
66  }
67  return Status::NotImplemented("Type not implemented");
68 }
69 
70 #undef TYPE_VISIT_INLINE
71 
72 #define ARRAY_VISIT_INLINE(TYPE_CLASS) \
73  case TYPE_CLASS::type_id: \
74  return visitor->Visit( \
75  internal::checked_cast<const typename TypeTraits<TYPE_CLASS>::ArrayType&>( \
76  array));
77 
78 template <typename VISITOR>
79 inline Status VisitArrayInline(const Array& array, VISITOR* visitor) {
80  switch (array.type_id()) {
107  default:
108  break;
109  }
110  return Status::NotImplemented("Type not implemented");
111 }
112 
113 } // namespace arrow
114 
115 #endif // ARROW_VISITOR_INLINE_H
Concrete type class for struct data.
Definition: type.h:494
Concrete type class for 16-bit floating-point data.
Definition: type.h:394
Concrete type class for unsigned 8-bit integer data.
Definition: type.h:338
Concrete type class for 64-bit floating-point data (C "double")
Definition: type.h:410
Concrete type class for 64-bit date data (as number of milliseconds since UNIX epoch) ...
Definition: type.h:610
#define ARRAY_VISIT_INLINE(TYPE_CLASS)
Definition: visitor_inline.h:72
Type::type id() const
Definition: type.h:177
Definition: status.h:95
Type::type type_id() const
Definition: array.h:231
Status VisitTypeInline(const DataType &type, VISITOR *visitor)
Definition: visitor_inline.h:36
Concrete type class for unsigned 16-bit integer data.
Definition: type.h:352
Definition: type.h:688
Status VisitArrayInline(const Array &array, VISITOR *visitor)
Definition: visitor_inline.h:79
Concrete type class for unsigned 32-bit integer data.
Definition: type.h:366
Concrete type class for always-null data.
Definition: type.h:311
Concrete type class for variable-size binary data.
Definition: type.h:445
Concrete type class for boolean data.
Definition: type.h:324
Concrete type class for list data.
Definition: type.h:422
Concrete type class for variable-size string data, utf8-encoded.
Definition: type.h:482
Top-level namespace for Apache Arrow C++ API.
Definition: adapter.h:32
Array base type Immutable data array with some logical type and some length.
Definition: array.h:200
Concrete type class for 128-bit decimal data.
Definition: type.h:535
Concrete type class for 32-bit floating-point data (C "float")
Definition: type.h:402
Concrete type class for signed 16-bit integer data.
Definition: type.h:359
Concrete type class for signed 32-bit integer data.
Definition: type.h:373
Concrete type class for 32-bit date data (as number of days since UNIX epoch)
Definition: type.h:593
static Status NotImplemented(const std::string &msg)
Definition: status.h:146
Concrete type class for dictionary data.
Definition: type.h:741
Definition: type.h:673
Concrete type class for unsigned 64-bit integer data.
Definition: type.h:380
Concrete type class for signed 8-bit integer data.
Definition: type.h:345
Definition: type.h:658
#define TYPE_VISIT_INLINE(TYPE_CLASS)
Definition: visitor_inline.h:31
Base class for all data types.
Definition: type.h:148
Concrete type class for union data.
Definition: type.h:552
Concrete type class for signed 64-bit integer data.
Definition: type.h:387
Concrete type class for fixed-size binary data.
Definition: type.h:461