sparrow 2.2.1
C++20 idiomatic APIs for the Apache Arrow Columnar Format
Loading...
Searching...
No Matches
primitive_array.hpp
Go to the documentation of this file.
1// Copyright 2024 Man Group Operations Limited
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or mplied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
19
20namespace sparrow
21{
22 template <typename T>
23 concept primitive_type = std::is_arithmetic_v<T> || std::is_same_v<T, float16_t> || std::is_same_v<T, bool>;
24
25 namespace detail
26 {
27 template <primitive_type T>
29 {
30 // Using data_type_from_size instead of specializing primitive_data_traits
31 // for all integers and floating point types nicely handles platforms
32 // where std::size_t or unsigned long are not the same as fixed width
33 // integer types.
35 };
36
37 template <>
42 }
43
60 template <primitive_type T, typename Ext = empty_extension, trivial_copyable_type T2 = T>
62
63 template <class T>
64 struct is_primitive_array : std::false_type
65 {
66 };
67
68 template <class T, typename Ext, trivial_copyable_type T2>
69 struct is_primitive_array<primitive_array<T, Ext, T2>> : std::true_type
70 {
71 };
72
76 template <class T>
78}
constexpr bool is_primitive_array_v
Checkes whether T is a primitive_array type.
primitive_array_impl< T, Ext, T2 > primitive_array
Array of values of whose type has fixed binary size.
constexpr data_type data_type_from_size(T={}) noexcept
data_type
Runtime identifier of arrow data types, usually associated with raw bytes with the associated value.
static constexpr sparrow::data_type type_id
static constexpr sparrow::data_type type_id