libtcspc C++ API
Streaming TCSPC and time tag data processing
Loading...
Searching...
No Matches
histogram_policy.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 <type_traits>
10
11namespace tcspc {
12
29enum class histogram_policy : unsigned {
34
44
54
62
80
89
109
124
141
159};
160
162constexpr auto operator|(histogram_policy lhs, histogram_policy rhs) noexcept
164 using U = std::underlying_type_t<histogram_policy>;
165 return static_cast<histogram_policy>(static_cast<U>(lhs) |
166 static_cast<U>(rhs));
167}
168
170constexpr auto operator&(histogram_policy lhs, histogram_policy rhs) noexcept
172 using U = std::underlying_type_t<histogram_policy>;
173 return static_cast<histogram_policy>(static_cast<U>(lhs) &
174 static_cast<U>(rhs));
175}
176
178constexpr auto operator~(histogram_policy hp) noexcept -> histogram_policy {
179 using U = std::underlying_type_t<histogram_policy>;
180 return static_cast<histogram_policy>(~static_cast<U>(hp));
181}
182
184constexpr auto operator|=(histogram_policy &lhs, histogram_policy rhs) noexcept
185 -> histogram_policy & {
186 return lhs = lhs | rhs;
187}
188
190constexpr auto operator&=(histogram_policy &lhs, histogram_policy rhs) noexcept
191 -> histogram_policy & {
192 return lhs = lhs & rhs;
193}
194
195} // namespace tcspc
histogram_policy
Histogramming policy specifying behavior.
Definition histogram_policy.hpp:29
@ stop_on_overflow
Treat a histogram bin overflow as end of processing.
Definition histogram_policy.hpp:53
@ saturate_on_overflow
Ignore increments that would cause a bin overflow.
Definition histogram_policy.hpp:61
@ reset_on_overflow
Perform a reset when a histogram bin is about to overflow.
Definition histogram_policy.hpp:79
@ overflow_mask
Bitmask for overflow behavior.
Definition histogram_policy.hpp:88
@ reset_after_scan
Automatically reset when the end of a scan has been reached.
Definition histogram_policy.hpp:123
@ no_clear_new_bucket
Do not zero-fill the histogram array at the beginning of a round of accumulation.
Definition histogram_policy.hpp:158
@ emit_concluding_events
Enable generation of tcspc::concluding_histogram_array_event.
Definition histogram_policy.hpp:108
@ default_policy
Default policy with no bit set: equal to error_on_overflow.
Definition histogram_policy.hpp:33
@ clear_every_scan
Clear element histograms before applying bin increment batches, during every scan.
Definition histogram_policy.hpp:140
@ error_on_overflow
Treat a histogram bin overflow as an error.
Definition histogram_policy.hpp:43
libtcspc namespace.
Definition acquire.hpp:29