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"
27 
28 namespace arrow {
29 
30 #define TYPE_VISIT_INLINE(TYPE_CLASS) \
31  case TYPE_CLASS::type_id: \
32  return visitor->Visit(static_cast<const TYPE_CLASS&>(type));
33 
34 template <typename VISITOR>
35 inline Status VisitTypeInline(const DataType& type, VISITOR* visitor) {
36  switch (type.id()) {
63  default:
64  break;
65  }
66  return Status::NotImplemented("Type not implemented");
67 }
68 
69 #undef TYPE_VISIT_INLINE
70 
71 #define ARRAY_VISIT_INLINE(TYPE_CLASS) \
72  case TYPE_CLASS::type_id: \
73  return visitor->Visit( \
74  static_cast<const typename TypeTraits<TYPE_CLASS>::ArrayType&>(array));
75 
76 template <typename VISITOR>
77 inline Status VisitArrayInline(const Array& array, VISITOR* visitor) {
78  switch (array.type_id()) {
105  default:
106  break;
107  }
108  return Status::NotImplemented("Type not implemented");
109 }
110 
111 } // namespace arrow
112 
113 #endif // ARROW_VISITOR_INLINE_H
Definition: type.h:459
Definition: type.h:367
Definition: type.h:319
Definition: type.h:381
Date as int64_t milliseconds since UNIX epoch.
Definition: type.h:561
#define ARRAY_VISIT_INLINE(TYPE_CLASS)
Definition: visitor_inline.h:71
Type::type id() const
Definition: type.h:165
Definition: status.h:106
Type::type type_id() const
Definition: array.h:227
Status VisitTypeInline(const DataType &type, VISITOR *visitor)
Definition: visitor_inline.h:35
Definition: type.h:331
Definition: type.h:638
Status VisitArrayInline(const Array &array, VISITOR *visitor)
Definition: visitor_inline.h:77
Definition: type.h:343
Definition: type.h:294
Definition: type.h:411
Definition: type.h:306
Definition: type.h:388
Definition: type.h:448
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:196
Definition: type.h:488
Definition: type.h:374
Definition: type.h:337
Definition: type.h:349
Date as int32_t days since UNIX epoch.
Definition: type.h:544
static Status NotImplemented(const std::string &msg)
Definition: status.h:138
Definition: type.h:690
Definition: type.h:623
Definition: type.h:355
Definition: type.h:325
Definition: type.h:608
#define TYPE_VISIT_INLINE(TYPE_CLASS)
Definition: visitor_inline.h:30
Definition: type.h:136
Definition: type.h:504
Definition: type.h:361
Definition: type.h:427