libtcspc C++ API
Streaming TCSPC and time tag data processing
Loading...
Searching...
No Matches
numeric_traits.hpp
1/*
2 * This file is part of libtcspc
3 * Copyright 2019-2026 Board of Regents of the University of Wisconsin System
4 * SPDX-License-Identifier: MIT
5 */
6
7#pragma once
8
9#include "int_types.hpp"
10
11#include <concepts>
12
13namespace tcspc {
14
37
42
47
53 using count_type = u32;
54
59
64
68 using bin_type = u16;
69};
70
77template <typename NT>
78concept with_abstime_type = std::integral<typename NT::abstime_type>;
79
86template <typename NT>
87concept with_channel_type = std::integral<typename NT::channel_type>;
88
95template <typename NT>
96concept with_difftime_type = std::integral<typename NT::difftime_type>;
97
104template <typename NT>
105concept with_count_type = std::integral<typename NT::count_type>;
106
113template <typename NT>
114concept with_datapoint_type = std::integral<typename NT::datapoint_type>;
115
122template <typename NT>
123concept with_bin_index_type = std::integral<typename NT::bin_index_type>;
124
131template <typename NT>
132concept with_bin_type = std::integral<typename NT::bin_type>;
133
134} // namespace tcspc
Concept that is satisfied when NT provides an integral abstime_type.
Definition numeric_traits.hpp:78
Concept that is satisfied when NT provides an integral bin_index_type.
Definition numeric_traits.hpp:123
Concept that is satisfied when NT provides an integral bin_type.
Definition numeric_traits.hpp:132
Concept that is satisfied when NT provides an integral channel_type.
Definition numeric_traits.hpp:87
Concept that is satisfied when NT provides an integral count_type.
Definition numeric_traits.hpp:105
Concept that is satisfied when NT provides an integral datapoint_type.
Definition numeric_traits.hpp:114
Concept that is satisfied when NT provides an integral difftime_type.
Definition numeric_traits.hpp:96
std::int32_t i32
Short name for int32_t.
Definition int_types.hpp:42
std::int64_t i64
Short name for int64_t.
Definition int_types.hpp:45
std::uint16_t u16
Short name for uint16_t.
Definition int_types.hpp:27
std::uint32_t u32
Short name for uint32_t.
Definition int_types.hpp:30
libtcspc namespace.
Definition acquire.hpp:30
The default numeric traits.
Definition numeric_traits.hpp:27
i32 channel_type
Channel number type.
Definition numeric_traits.hpp:41
i64 abstime_type
Absolute time type.
Definition numeric_traits.hpp:36
u32 count_type
Count type.
Definition numeric_traits.hpp:53
i32 difftime_type
Difference time type.
Definition numeric_traits.hpp:46
u16 bin_index_type
Type of histogram bin index.
Definition numeric_traits.hpp:63
i32 datapoint_type
Type of datapoint for histogramming.
Definition numeric_traits.hpp:58
u16 bin_type
Type of histogram bin value (count).
Definition numeric_traits.hpp:68