libtcspc C++ API
Streaming TCSPC and time tag data processing
Loading...
Searching...
No Matches
histogram_events.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 "bucket.hpp"
10#include "numeric_traits.hpp"
11
12#include <cstddef>
13#include <ostream>
14
15namespace tcspc {
16
24template <typename NumericTraits = default_numeric_traits>
29 using datapoint_type = NumericTraits::datapoint_type;
30
35
37 friend constexpr auto operator==(datapoint_event const &lhs,
38 datapoint_event const &rhs) noexcept
39 -> bool = default;
40
42 friend auto operator<<(std::ostream &s, datapoint_event const &e)
43 -> std::ostream & {
44 return s << "datapoint(" << e.value << ')';
45 }
46};
47
55template <typename NumericTraits = default_numeric_traits>
60 NumericTraits::bin_index_type bin_index;
61
63 friend constexpr auto operator==(bin_increment_event const &lhs,
64 bin_increment_event const &rhs) noexcept
65 -> bool = default;
66
68 friend auto operator<<(std::ostream &s, bin_increment_event const &e)
69 -> std::ostream & {
70 return s << "bin_increment(" << e.bin_index << ')';
71 }
72};
73
84template <typename NumericTraits = default_numeric_traits>
90
93 bin_increment_cluster_event const &rhs) noexcept
94 -> bool = default;
95
97 friend auto operator<<(std::ostream &s,
99 -> std::ostream & {
100 return s << "bin_increment_cluster(" << e.bin_indices << ')';
101 }
102};
103
114template <typename NumericTraits = default_numeric_traits>
120
122 friend auto operator==(histogram_event const &lhs,
123 histogram_event const &rhs) noexcept
124 -> bool = default;
125
127 friend auto operator<<(std::ostream &s, histogram_event const &e)
128 -> std::ostream & {
129 return s << "histogram(" << e.data_bucket << ')';
130 }
131};
132
145template <typename NumericTraits = default_numeric_traits>
151
154 concluding_histogram_event const &rhs) noexcept
155 -> bool = default;
156
158 friend auto operator<<(std::ostream &s,
160 -> std::ostream & {
161 return s << "concluding_histogram(" << e.data_bucket << ')';
162 }
163};
164
172template <typename NumericTraits = default_numeric_traits>
178
180 friend auto operator==(histogram_array_event const &lhs,
181 histogram_array_event const &rhs) noexcept
182 -> bool = default;
183
185 friend auto operator<<(std::ostream &s, histogram_array_event const &e)
186 -> std::ostream & {
187 return s << "histogram_array(" << e.data_bucket << ')';
188 }
189};
190
201template <typename NumericTraits = default_numeric_traits>
206 std::size_t valid_size;
207
216
219 histogram_array_progress_event const &rhs) noexcept
220 -> bool = default;
221
223 friend auto operator<<(std::ostream &s,
225 -> std::ostream & {
226 return s << "histogram_array_progress(" << e.valid_size << ", "
227 << e.data_bucket << ')';
228 }
229};
230
244template <typename NumericTraits = default_numeric_traits>
250
252 friend auto
254 concluding_histogram_array_event const &rhs) noexcept
255 -> bool = default;
256
258 friend auto operator<<(std::ostream &s,
260 -> std::ostream & {
261 return s << "concluding_histogram_array(" << e.data_bucket << ')';
262 }
263};
264
265} // namespace tcspc
Value-semantic container for array data allowing use of custom storage.
Definition bucket.hpp:110
libtcspc namespace.
Definition acquire.hpp:30
Event representing a cluster of data points binned for histogramming.
Definition histogram_events.hpp:85
friend auto operator<<(std::ostream &s, bin_increment_cluster_event const &e) -> std::ostream &
Stream insertion operator for bin_increment_cluster_event.
Definition histogram_events.hpp:97
bucket< typename NumericTraits::bin_index_type > bin_indices
The bin indices for the datapoints in the cluster.
Definition histogram_events.hpp:89
friend auto operator==(bin_increment_cluster_event const &lhs, bin_increment_cluster_event const &rhs) noexcept -> bool=default
Equality comparison operator.
Event representing data binned for histogramming.
Definition histogram_events.hpp:56
friend auto operator<<(std::ostream &s, bin_increment_event const &e) -> std::ostream &
Stream insertion operator.
Definition histogram_events.hpp:68
friend constexpr auto operator==(bin_increment_event const &lhs, bin_increment_event const &rhs) noexcept -> bool=default
Equality comparison operator.
NumericTraits::bin_index_type bin_index
The histogram bin index to which the data value was mapped.
Definition histogram_events.hpp:60
Event representing the final result of accumulation of a histogram array.
Definition histogram_events.hpp:245
friend auto operator==(concluding_histogram_array_event const &lhs, concluding_histogram_array_event const &rhs) noexcept -> bool=default
Equality comparison operator.
bucket< typename NumericTraits::bin_type > data_bucket
View of the histogram array.
Definition histogram_events.hpp:249
friend auto operator<<(std::ostream &s, concluding_histogram_array_event const &e) -> std::ostream &
Stream insertion operator.
Definition histogram_events.hpp:258
Event representing the final result of histogramming.
Definition histogram_events.hpp:146
bucket< typename NumericTraits::bin_type > data_bucket
The accumulated histogram.
Definition histogram_events.hpp:150
friend auto operator<<(std::ostream &s, concluding_histogram_event const &e) -> std::ostream &
Stream insertion operator.
Definition histogram_events.hpp:158
friend auto operator==(concluding_histogram_event const &lhs, concluding_histogram_event const &rhs) noexcept -> bool=default
Equality comparison operator.
Event representing a datapoint for histogramming.
Definition histogram_events.hpp:25
datapoint_type value
The datapoint value.
Definition histogram_events.hpp:34
NumericTraits::datapoint_type datapoint_type
The data type.
Definition histogram_events.hpp:29
friend auto operator<<(std::ostream &s, datapoint_event const &e) -> std::ostream &
Stream insertion operator.
Definition histogram_events.hpp:42
friend constexpr auto operator==(datapoint_event const &lhs, datapoint_event const &rhs) noexcept -> bool=default
Equality comparison operator.
Event representing an array of histograms.
Definition histogram_events.hpp:173
friend auto operator==(histogram_array_event const &lhs, histogram_array_event const &rhs) noexcept -> bool=default
Equality comparison operator.
friend auto operator<<(std::ostream &s, histogram_array_event const &e) -> std::ostream &
Stream insertion operator.
Definition histogram_events.hpp:185
bucket< typename NumericTraits::bin_type > data_bucket
Histogram array, or view thereof.
Definition histogram_events.hpp:177
Event representing a progress update of a histogram array.
Definition histogram_events.hpp:202
bucket< typename NumericTraits::bin_type > data_bucket
View of the histogram array.
Definition histogram_events.hpp:215
friend auto operator<<(std::ostream &s, histogram_array_progress_event const &e) -> std::ostream &
Stream insertion operator.
Definition histogram_events.hpp:223
friend auto operator==(histogram_array_progress_event const &lhs, histogram_array_progress_event const &rhs) noexcept -> bool=default
Equality comparison operator.
std::size_t valid_size
Size of the updated part of the histogram array.
Definition histogram_events.hpp:206
Event representing a single histogram.
Definition histogram_events.hpp:115
bucket< typename NumericTraits::bin_type > data_bucket
The histogram.
Definition histogram_events.hpp:119
friend auto operator==(histogram_event const &lhs, histogram_event const &rhs) noexcept -> bool=default
Equality comparison operator.
friend auto operator<<(std::ostream &s, histogram_event const &e) -> std::ostream &
Stream insertion operator.
Definition histogram_events.hpp:127