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(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  checked_cast<const typename TypeTraits<TYPE_CLASS>::ArrayType&>(array));
76 
77 template <typename VISITOR>
78 inline Status VisitArrayInline(const Array& array, VISITOR* visitor) {
79  switch (array.type_id()) {
106  default:
107  break;
108  }
109  return Status::NotImplemented("Type not implemented");
110 }
111 
112 } // namespace arrow
113 
114 #endif // ARROW_VISITOR_INLINE_H
Definition: type.h:469
Definition: type.h:364
Definition: type.h:316
Definition: type.h:378
Date as int64_t milliseconds since UNIX epoch.
Definition: type.h:581
#define ARRAY_VISIT_INLINE(TYPE_CLASS)
Definition: visitor_inline.h:72
Type::type id() const
Definition: type.h:166
Definition: status.h:93
Type::type type_id() const
Definition: array.h:231
Status VisitTypeInline(const DataType &type, VISITOR *visitor)
Definition: visitor_inline.h:36
Definition: type.h:328
Definition: type.h:658
Status VisitArrayInline(const Array &array, VISITOR *visitor)
Definition: visitor_inline.h:78
Definition: type.h:340
Definition: type.h:291
Definition: type.h:421
Definition: type.h:303
Definition: type.h:385
Definition: type.h:458
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
Definition: type.h:508
Definition: type.h:371
Definition: type.h:334
Definition: type.h:346
Date as int32_t days since UNIX epoch.
Definition: type.h:564
static Status NotImplemented(const std::string &msg)
Definition: status.h:125
Definition: type.h:710
Definition: type.h:643
Definition: type.h:352
Definition: type.h:322
Definition: type.h:628
#define TYPE_VISIT_INLINE(TYPE_CLASS)
Definition: visitor_inline.h:31
Definition: type.h:137
Definition: type.h:524
Definition: type.h:358
Definition: type.h:437