sparrow 0.9.0
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
17#include <cstdint>
18
21
22namespace sparrow
23{
24 template <typename T>
25 concept primitive_type = std::is_arithmetic_v<T> || std::is_same_v<T, float16_t> || std::is_same_v<T, bool>;
26
27 namespace detail
28 {
29 template <primitive_type T>
31 {
32 // Using data_type_from_size instead of specializing primitive_data_traits
33 // for all integers and floating point types nicely handles platforms
34 // where std::size_t or unsigned long are not the same as fixed width
35 // integer types.
37 };
38
39 template <>
44 }
45
62 template <primitive_type T>
64
65 template <class T>
66 struct is_primitive_array : std::false_type
67 {
68 };
69
70 template <class T>
71 struct is_primitive_array<primitive_array<T>> : std::true_type
72 {
73 };
74
78 template <class T>
80}
constexpr bool is_primitive_array_v
Checkes whether T is a primitive_array type.
primitive_array_impl< T > 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