sparrow ..
Loading...
Searching...
No Matches
duration_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
18
19// tDs : std::chrono::seconds
20// tDm : std::chrono::milliseconds
21// tDu : std::chrono::microseconds
22// tDn : std::chrono::nanoseconds
23
24namespace sparrow
25{
26 using duration_types_t = mpl::
27 typelist<std::chrono::seconds, std::chrono::milliseconds, std::chrono::microseconds, std::chrono::nanoseconds>;
28
29 template <typename T>
31
32 namespace detail
33 {
34 template <>
35 struct primitive_data_traits<std::chrono::seconds>
36 {
38 };
39
40 template <>
41 struct primitive_data_traits<std::chrono::milliseconds>
42 {
44 };
45
46 template <>
47 struct primitive_data_traits<std::chrono::microseconds>
48 {
50 };
51
52 template <>
53 struct primitive_data_traits<std::chrono::nanoseconds>
54 {
56 };
57 }
58
70 template <duration_type T>
72
93
94 template <class T>
95 struct is_duration_array : std::false_type
96 {
97 };
98
99 template <class T>
100 struct is_duration_array<duration_array<T>> : std::true_type
101 {
102 };
103
107 template <class T>
109}
consteval bool contains()
Checks if a typelist contains a specific type.
Definition mp_utils.hpp:633
duration_array< std::chrono::seconds > duration_seconds_array
A duration array for std::chrono::seconds values.
primitive_array_impl< T > duration_array
Array of std::chrono::duration values.
constexpr bool is_duration_array_v
Checks whether T is a duration_array type.
duration_array< std::chrono::microseconds > duration_microseconds_array
A duration array for std::chrono::microseconds values.
duration_array< std::chrono::milliseconds > duration_milliseconds_array
A duration array for std::chrono::milliseconds values.
duration_array< std::chrono::nanoseconds > duration_nanoseconds_array
A duration array for std::chrono::nanoseconds values.
data_type
Runtime identifier of arrow data types, usually associated with raw bytes with the associated value.
mpl:: typelist< std::chrono::seconds, std::chrono::milliseconds, std::chrono::microseconds, std::chrono::nanoseconds > duration_types_t