Back to home page

EIC code displayed by LXR

 
 

    


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

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 #pragma once
0019 
0020 #include "arrow/extension_type.h"
0021 
0022 namespace arrow::extension {
0023 
0024 /// \brief Bool8 is an alternate representation for boolean
0025 /// arrays using 8 bits instead of 1 bit per value. The underlying
0026 /// storage type is int8.
0027 class ARROW_EXPORT Bool8Array : public ExtensionArray {
0028  public:
0029   using ExtensionArray::ExtensionArray;
0030 };
0031 
0032 /// \brief Bool8 is an alternate representation for boolean
0033 /// arrays using 8 bits instead of 1 bit per value. The underlying
0034 /// storage type is int8.
0035 class ARROW_EXPORT Bool8Type : public ExtensionType {
0036  public:
0037   /// \brief Construct a Bool8Type.
0038   Bool8Type() : ExtensionType(int8()) {}
0039 
0040   std::string extension_name() const override { return "arrow.bool8"; }
0041   std::string ToString(bool show_metadata = false) const override;
0042 
0043   bool ExtensionEquals(const ExtensionType& other) const override;
0044 
0045   std::string Serialize() const override;
0046 
0047   Result<std::shared_ptr<DataType>> Deserialize(
0048       std::shared_ptr<DataType> storage_type,
0049       const std::string& serialized_data) const override;
0050 
0051   /// Create a Bool8Array from ArrayData
0052   std::shared_ptr<Array> MakeArray(std::shared_ptr<ArrayData> data) const override;
0053 
0054   static Result<std::shared_ptr<DataType>> Make();
0055 };
0056 
0057 /// \brief Return a Bool8Type instance.
0058 ARROW_EXPORT std::shared_ptr<DataType> bool8();
0059 
0060 }  // namespace arrow::extension