sparrow
2.4.0
C++20 idiomatic APIs for the Apache Arrow Columnar Format
Toggle main menu visibility
Loading...
Searching...
No Matches
time_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 implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#pragma once
16
17
#include "
sparrow/layout/primitive_array_impl.hpp
"
18
#include "
sparrow/layout/time_types.hpp
"
19
20
// tts : std::chrono::seconds
21
22
namespace
sparrow
23
{
24
using
time_types_t
= mpl::
25
typelist<chrono::time_seconds, chrono::time_milliseconds, chrono::time_microseconds, chrono::time_nanoseconds>;
26
27
template
<
typename
T>
28
concept
time_type
=
mpl::contains<time_types_t, T>
();
29
30
namespace
detail
31
{
32
template
<>
33
struct
primitive_data_traits
<
chrono
::time_seconds>
34
{
35
static
constexpr
sparrow::data_type
type_id
=
sparrow::data_type::TIME_SECONDS
;
36
};
37
38
template
<>
39
struct
primitive_data_traits
<
chrono
::time_milliseconds>
40
{
41
static
constexpr
sparrow::data_type
type_id
=
sparrow::data_type::TIME_MILLISECONDS
;
42
};
43
44
template
<>
45
struct
primitive_data_traits
<
chrono
::time_microseconds>
46
{
47
static
constexpr
sparrow::data_type
type_id
=
sparrow::data_type::TIME_MICROSECONDS
;
48
};
49
50
template
<>
51
struct
primitive_data_traits
<
chrono
::time_nanoseconds>
52
{
53
static
constexpr
sparrow::data_type
type_id
=
sparrow::data_type::TIME_NANOSECONDS
;
54
};
55
}
56
69
template
<time_type T>
70
using
time_array
=
primitive_array_impl<T>
;
71
76
using
time_seconds_array
=
time_array<chrono::time_seconds>
;
81
using
time_milliseconds_array
=
time_array<chrono::time_milliseconds>
;
86
using
time_microseconds_array
=
time_array<chrono::time_microseconds>
;
91
using
time_nanoseconds_array
=
time_array<chrono::time_nanoseconds>
;
92
93
template
<
class
T>
94
struct
is_time_array
: std::false_type
95
{
96
};
97
98
template
<
class
T>
99
struct
is_time_array
<
time_array
<T>> : std::true_type
100
{
101
};
102
106
template
<
class
T>
107
constexpr
bool
is_time_array_v
=
is_time_array<T>::value
;
108
}
sparrow::primitive_array_impl
Definition
primitive_array_impl.hpp:125
sparrow::time_type
Definition
time_array.hpp:28
sparrow::chrono
Definition
temporal_types.hpp:20
sparrow::detail
Definition
dynamic_bitset.hpp:391
sparrow::mpl::contains
consteval bool contains()
Checks if a typelist contains a specific type.
Definition
mp_utils.hpp:633
sparrow
Definition
array.hpp:21
sparrow::time_microseconds_array
time_array< chrono::time_microseconds > time_microseconds_array
A time array for std::chrono::time_microseconds values.
Definition
time_array.hpp:86
sparrow::time_milliseconds_array
time_array< chrono::time_milliseconds > time_milliseconds_array
A time array for std::chrono::time_milliseconds values.
Definition
time_array.hpp:81
sparrow::time_array
primitive_array_impl< T > time_array
Array of time values.
Definition
time_array.hpp:70
sparrow::is_time_array_v
constexpr bool is_time_array_v
Checks whether T is a time_array type.
Definition
time_array.hpp:107
sparrow::time_nanoseconds_array
time_array< chrono::time_nanoseconds > time_nanoseconds_array
A time array for std::chrono::time_nanoseconds values.
Definition
time_array.hpp:91
sparrow::time_seconds_array
time_array< chrono::time_seconds > time_seconds_array
A time array for std::chrono::time_seconds values.
Definition
time_array.hpp:76
sparrow::time_types_t
mpl:: typelist< chrono::time_seconds, chrono::time_milliseconds, chrono::time_microseconds, chrono::time_nanoseconds > time_types_t
Definition
time_array.hpp:24
sparrow::data_type
data_type
Runtime identifier of arrow data types, usually associated with raw bytes with the associated value.
Definition
data_type.hpp:177
sparrow::data_type::TIME_NANOSECONDS
@ TIME_NANOSECONDS
Definition
data_type.hpp:223
sparrow::data_type::TIME_MICROSECONDS
@ TIME_MICROSECONDS
Definition
data_type.hpp:222
sparrow::data_type::TIME_SECONDS
@ TIME_SECONDS
Definition
data_type.hpp:220
sparrow::data_type::TIME_MILLISECONDS
@ TIME_MILLISECONDS
Definition
data_type.hpp:221
primitive_array_impl.hpp
sparrow::detail::primitive_data_traits< chrono::time_microseconds >::type_id
static constexpr sparrow::data_type type_id
Definition
time_array.hpp:47
sparrow::detail::primitive_data_traits< chrono::time_milliseconds >::type_id
static constexpr sparrow::data_type type_id
Definition
time_array.hpp:41
sparrow::detail::primitive_data_traits< chrono::time_nanoseconds >::type_id
static constexpr sparrow::data_type type_id
Definition
time_array.hpp:53
sparrow::detail::primitive_data_traits< chrono::time_seconds >::type_id
static constexpr sparrow::data_type type_id
Definition
time_array.hpp:35
sparrow::detail::primitive_data_traits
Definition
primitive_array_impl.hpp:69
sparrow::is_time_array
Definition
time_array.hpp:95
time_types.hpp
sparrow
time_array.hpp
Generated by
1.17.0