Back to home page

EIC code displayed by LXR

 
 

    


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

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 <cstdint>
0021 #include <memory>
0022 #include <string>
0023 
0024 #include "arrow/array/array_binary.h"
0025 #include "arrow/array/data.h"
0026 #include "arrow/type.h"
0027 #include "arrow/util/visibility.h"
0028 
0029 namespace arrow {
0030 
0031 /// \addtogroup numeric-arrays
0032 ///
0033 /// @{
0034 
0035 // ----------------------------------------------------------------------
0036 // Decimal32Array
0037 
0038 /// Concrete Array class for 32-bit decimal data
0039 class ARROW_EXPORT Decimal32Array : public FixedSizeBinaryArray {
0040  public:
0041   using TypeClass = Decimal32Type;
0042 
0043   using FixedSizeBinaryArray::FixedSizeBinaryArray;
0044 
0045   /// \brief Construct Decimal32Array from ArrayData instance
0046   explicit Decimal32Array(const std::shared_ptr<ArrayData>& data);
0047 
0048   std::string FormatValue(int64_t i) const;
0049 };
0050 
0051 // ----------------------------------------------------------------------
0052 // Decimal64Array
0053 
0054 /// Concrete Array class for 64-bit decimal data
0055 class ARROW_EXPORT Decimal64Array : public FixedSizeBinaryArray {
0056  public:
0057   using TypeClass = Decimal64Type;
0058 
0059   using FixedSizeBinaryArray::FixedSizeBinaryArray;
0060 
0061   /// \brief Construct Decimal64Array from ArrayData instance
0062   explicit Decimal64Array(const std::shared_ptr<ArrayData>& data);
0063 
0064   std::string FormatValue(int64_t i) const;
0065 };
0066 
0067 // ----------------------------------------------------------------------
0068 // Decimal128Array
0069 
0070 /// Concrete Array class for 128-bit decimal data
0071 class ARROW_EXPORT Decimal128Array : public FixedSizeBinaryArray {
0072  public:
0073   using TypeClass = Decimal128Type;
0074 
0075   using FixedSizeBinaryArray::FixedSizeBinaryArray;
0076 
0077   /// \brief Construct Decimal128Array from ArrayData instance
0078   explicit Decimal128Array(const std::shared_ptr<ArrayData>& data);
0079 
0080   std::string FormatValue(int64_t i) const;
0081 };
0082 
0083 // Backward compatibility
0084 using DecimalArray = Decimal128Array;
0085 
0086 // ----------------------------------------------------------------------
0087 // Decimal256Array
0088 
0089 /// Concrete Array class for 256-bit decimal data
0090 class ARROW_EXPORT Decimal256Array : public FixedSizeBinaryArray {
0091  public:
0092   using TypeClass = Decimal256Type;
0093 
0094   using FixedSizeBinaryArray::FixedSizeBinaryArray;
0095 
0096   /// \brief Construct Decimal256Array from ArrayData instance
0097   explicit Decimal256Array(const std::shared_ptr<ArrayData>& data);
0098 
0099   std::string FormatValue(int64_t i) const;
0100 };
0101 
0102 /// @}
0103 
0104 }  // namespace arrow