Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-08-28 08:26:59

0001 // Licensed to the Apache Software Foundation (ASF) under one
0002 // or more contributor license agreements.  See the NOTICE file
0003 // distributed with this work for additional information
0004 // regarding copyright ownership.  The ASF licenses this file
0005 // to you under the Apache License, Version 2.0 (the
0006 // "License"); you may not use this file except in compliance
0007 // with the License.  You may obtain a copy of the License at
0008 //
0009 //   http://www.apache.org/licenses/LICENSE-2.0
0010 //
0011 // Unless required by applicable law or agreed to in writing,
0012 // software distributed under the License is distributed on an
0013 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
0014 // KIND, either express or implied.  See the License for the
0015 // specific language governing permissions and limitations
0016 // under the License.
0017 
0018 // Transform stream implementations
0019 
0020 #pragma once
0021 
0022 #include <cstdint>
0023 #include <functional>
0024 #include <memory>
0025 #include <utility>
0026 
0027 #include "arrow/io/interfaces.h"
0028 #include "arrow/util/visibility.h"
0029 
0030 namespace arrow {
0031 namespace io {
0032 
0033 class ARROW_EXPORT TransformInputStream : public InputStream {
0034  public:
0035   using TransformFunc =
0036       std::function<Result<std::shared_ptr<Buffer>>(const std::shared_ptr<Buffer>&)>;
0037 
0038   TransformInputStream(std::shared_ptr<InputStream> wrapped, TransformFunc transform);
0039   ~TransformInputStream() override;
0040 
0041   Status Close() override;
0042   Status Abort() override;
0043   bool closed() const override;
0044 
0045   Result<int64_t> Read(int64_t nbytes, void* out) override;
0046   Result<std::shared_ptr<Buffer>> Read(int64_t nbytes) override;
0047 
0048   Result<std::shared_ptr<const KeyValueMetadata>> ReadMetadata() override;
0049   Future<std::shared_ptr<const KeyValueMetadata>> ReadMetadataAsync(
0050       const IOContext& io_context) override;
0051 
0052   Result<int64_t> Tell() const override;
0053 
0054  protected:
0055   struct Impl;
0056   std::unique_ptr<Impl> impl_;
0057 };
0058 
0059 }  // namespace io
0060 }  // namespace arrow