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:485
Definition: type.h:387
Definition: type.h:339
Definition: type.h:401
Date as int64_t milliseconds since UNIX epoch.
Definition: type.h:580
#define ARRAY_VISIT_INLINE(TYPE_CLASS)
Definition: visitor_inline.h:71
Type::type id() const
Definition: type.h:181
Definition: status.h:106
Type::type type_id() const
Definition: array.h:211
Status VisitTypeInline(const DataType &type, VISITOR *visitor)
Definition: visitor_inline.h:35
Definition: type.h:351
Definition: type.h:657
Status VisitArrayInline(const Array &array, VISITOR *visitor)
Definition: visitor_inline.h:77
Definition: type.h:363
Definition: type.h:312
Definition: type.h:433
Definition: type.h:326
Definition: type.h:408
Definition: type.h:474
Definition: type.h:501
Top-level namespace for Apache Arrow C++ API.
Definition: allocator.h:29
Array base type Immutable data array with some logical type and some length.
Definition: array.h:180
Definition: type.h:394
Definition: type.h:357
Definition: type.h:369
Date as int32_t days since UNIX epoch.
Definition: type.h:563
static Status NotImplemented(const std::string &msg)
Definition: status.h:138
Definition: type.h:709
Definition: type.h:642
Definition: type.h:375
Definition: type.h:345
Definition: type.h:627
#define TYPE_VISIT_INLINE(TYPE_CLASS)
Definition: visitor_inline.h:30
Definition: type.h:150
Definition: type.h:522
Definition: type.h:381
Definition: type.h:451