iceberg-cpp
Loading...
Searching...
No Matches
arrow_c_data_guard_internal.h
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#pragma once
21
22#include <nanoarrow/nanoarrow.h>
23
25#include "iceberg/iceberg_export.h"
26
27namespace iceberg::internal {
28
29class ICEBERG_EXPORT ArrowArrayGuard {
30 public:
31 explicit ArrowArrayGuard(ArrowArray* array) : array_(array) {}
33
38 void Release() { array_ = nullptr; }
39
40 private:
41 ArrowArray* array_;
42};
43
44class ICEBERG_EXPORT ArrowSchemaGuard {
45 public:
46 explicit ArrowSchemaGuard(ArrowSchema* schema) : schema_(schema) {}
48
49 private:
50 ArrowSchema* schema_;
51};
52
53class ICEBERG_EXPORT ArrowArrayViewGuard {
54 public:
55 explicit ArrowArrayViewGuard(ArrowArrayView* view) : view_(view) {}
57
58 private:
59 ArrowArrayView* view_;
60};
61
62class ICEBERG_EXPORT ArrowArrayBufferGuard {
63 public:
64 explicit ArrowArrayBufferGuard(ArrowBuffer* buffer) : buffer_(buffer) {}
66
67 private:
68 ArrowBuffer* buffer_;
69};
70
71} // namespace iceberg::internal
Definition arrow_c_data_guard_internal.h:62
Definition arrow_c_data_guard_internal.h:29
void Release()
Release the guard without calling ArrowArrayRelease.
Definition arrow_c_data_guard_internal.h:38
Definition arrow_c_data_guard_internal.h:53
Definition arrow_c_data_guard_internal.h:44
Definition arrow_c_data.h:57
Definition arrow_c_data.h:41