libtcspc C++ API
Streaming TCSPC and time tag data processing
Loading...
Searching...
No Matches
arg_wrappers.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 <cstddef>
10
16namespace tcspc::arg {
17
18// Function argument wrappers for strong typing (avoiding mistakes with
19// otherwise easily swappable parameters). Each has a constructor for two
20// reasons: (1) To avoid default-constructing without initializing the value
21// and (2) so that CTAD works.
22// Ordered alphabetically.
23
27template <typename T> struct append {
31 explicit constexpr append(T arg) : value(arg) {}
32};
33
37template <typename T> struct abstime {
41 explicit constexpr abstime(T arg) : value(arg) {}
42};
43
47template <typename T = std::size_t> struct batch_size {
51 explicit constexpr batch_size(T arg) : value(arg) {}
52};
53
57template <typename T> struct bin_width {
61 explicit constexpr bin_width(T arg) : value(arg) {}
62};
63
67template <typename T = std::size_t> struct bucket_size {
71 explicit constexpr bucket_size(T arg) : value(arg) {}
72};
73
77template <typename T> struct channel {
81 explicit constexpr channel(T arg) : value(arg) {}
82};
83
87template <typename T> struct clamp {
91 explicit constexpr clamp(T arg) : value(arg) {}
92};
93
97template <typename T> struct count {
101 explicit constexpr count(T arg) : value(arg) {}
102};
103
107template <typename T = std::size_t> struct count_threshold {
111 explicit constexpr count_threshold(T arg) : value(arg) {}
112};
113
117template <typename T> struct delay {
121 explicit constexpr delay(T arg) : value(arg) {}
122};
123
127template <typename T> struct delta {
131 explicit constexpr delta(T arg) : value(arg) {}
132};
133
137template <typename T> struct fraction {
141 explicit constexpr fraction(T arg) : value(arg) {}
142};
143
147template <typename T = std::size_t> struct granularity {
151 explicit constexpr granularity(T arg) : value(arg) {}
152};
153
157template <typename T> struct initially_open {
161 explicit constexpr initially_open(T arg) : value(arg) {}
162};
163
167template <typename T> struct initial_count {
171 explicit constexpr initial_count(T arg) : value(arg) {}
172};
173
177template <typename T> struct interval {
181 explicit constexpr interval(T arg) : value(arg) {}
182};
183
187template <typename T> struct interval_threshold {
191 explicit constexpr interval_threshold(T arg) : value(arg) {}
192};
193
197template <typename T> struct length {
201 explicit constexpr length(T arg) : value(arg) {}
202};
203
207template <typename T> struct limit {
211 explicit constexpr limit(T arg) : value(arg) {}
212};
213
217template <typename T> struct max_bin_index {
221 explicit constexpr max_bin_index(T arg) : value(arg) {}
222};
223
227template <typename T = std::size_t> struct max_bucket_count {
231 explicit constexpr max_bucket_count(T arg) : value(arg) {}
232};
233
237template <typename T = std::size_t> struct max_buffered {
241 explicit constexpr max_buffered(T arg) : value(arg) {}
242};
243
247template <typename T> struct max_count {
251 explicit constexpr max_count(T arg) : value(arg) {}
252};
253
257template <typename T> struct max_interval {
261 explicit constexpr max_interval(T arg) : value(arg) {}
262};
263
267template <typename T> struct max_length {
271 explicit constexpr max_length(T arg) : value(arg) {}
272};
273
277template <typename T> struct max_mse {
281 explicit constexpr max_mse(T arg) : value(arg) {}
282};
283
287template <typename T> struct max_per_bin {
291 explicit constexpr max_per_bin(T arg) : value(arg) {}
292};
293
297template <typename T = std::size_t> struct max_recycled_size {
301 explicit constexpr max_recycled_size(T arg) : value(arg) {}
302};
303
307template <typename T> struct max_time_shift {
311 explicit constexpr max_time_shift(T arg) : value(arg) {}
312};
313
317template <typename T> struct min_interval {
321 explicit constexpr min_interval(T arg) : value(arg) {}
322};
323
327template <typename T = std::size_t> struct num_bins {
331 explicit constexpr num_bins(T arg) : value(arg) {}
332};
333
337template <typename T = std::size_t> struct num_elements {
341 explicit constexpr num_elements(T arg) : value(arg) {}
342};
343
347template <typename T> struct offset {
351 explicit constexpr offset(T arg) : value(arg) {}
352};
353
357template <typename T> struct start {
361 explicit constexpr start(T arg) : value(arg) {}
362};
363
367template <typename T> struct start_channel {
371 explicit constexpr start_channel(T arg) : value(arg) {}
372};
373
377template <typename T> struct start_offset {
381 explicit constexpr start_offset(T arg) : value(arg) {}
382};
383
387template <typename T> struct stop {
391 explicit constexpr stop(T arg) : value(arg) {}
392};
393
397template <typename T> struct threshold {
401 explicit constexpr threshold(T arg) : value(arg) {}
402};
403
407template <typename T> struct tick_index {
411 explicit constexpr tick_index(T arg) : value(arg) {}
412};
413
417template <typename T> struct time_window {
421 explicit constexpr time_window(T arg) : value(arg) {}
422};
423
427template <typename T> struct truncate {
431 explicit constexpr truncate(T arg) : value(arg) {}
432};
433
434} // namespace tcspc::arg
Argument wrappers.
T value
The argument value.
Definition arg_wrappers.hpp:39
constexpr abstime(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:41
constexpr append(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:31
T value
The argument value.
Definition arg_wrappers.hpp:29
constexpr batch_size(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:51
T value
The argument value.
Definition arg_wrappers.hpp:49
T value
The argument value.
Definition arg_wrappers.hpp:59
constexpr bin_width(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:61
T value
The argument value.
Definition arg_wrappers.hpp:69
constexpr bucket_size(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:71
T value
The argument value.
Definition arg_wrappers.hpp:79
constexpr channel(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:81
constexpr clamp(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:91
T value
The argument value.
Definition arg_wrappers.hpp:89
constexpr count_threshold(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:111
T value
The argument value.
Definition arg_wrappers.hpp:109
constexpr count(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:101
T value
The argument value.
Definition arg_wrappers.hpp:99
T value
The argument value.
Definition arg_wrappers.hpp:119
constexpr delay(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:121
T value
The argument value.
Definition arg_wrappers.hpp:129
constexpr delta(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:131
constexpr fraction(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:141
T value
The argument value.
Definition arg_wrappers.hpp:139
T value
The argument value.
Definition arg_wrappers.hpp:149
constexpr granularity(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:151
T value
The argument value.
Definition arg_wrappers.hpp:169
constexpr initial_count(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:171
T value
The argument value.
Definition arg_wrappers.hpp:159
constexpr initially_open(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:161
T value
The argument value.
Definition arg_wrappers.hpp:189
constexpr interval_threshold(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:191
T value
The argument value.
Definition arg_wrappers.hpp:179
constexpr interval(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:181
T value
The argument value.
Definition arg_wrappers.hpp:199
constexpr length(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:201
T value
The argument value.
Definition arg_wrappers.hpp:209
constexpr limit(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:211
constexpr max_bin_index(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:221
T value
The argument value.
Definition arg_wrappers.hpp:219
T value
The argument value.
Definition arg_wrappers.hpp:229
constexpr max_bucket_count(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:231
T value
The argument value.
Definition arg_wrappers.hpp:239
constexpr max_buffered(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:241
constexpr max_count(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:251
T value
The argument value.
Definition arg_wrappers.hpp:249
constexpr max_interval(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:261
T value
The argument value.
Definition arg_wrappers.hpp:259
constexpr max_length(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:271
T value
The argument value.
Definition arg_wrappers.hpp:269
constexpr max_mse(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:281
T value
The argument value.
Definition arg_wrappers.hpp:279
constexpr max_per_bin(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:291
T value
The argument value.
Definition arg_wrappers.hpp:289
constexpr max_recycled_size(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:301
T value
The argument value.
Definition arg_wrappers.hpp:299
constexpr max_time_shift(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:311
T value
The argument value.
Definition arg_wrappers.hpp:309
constexpr min_interval(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:321
T value
The argument value.
Definition arg_wrappers.hpp:319
T value
The argument value.
Definition arg_wrappers.hpp:329
constexpr num_bins(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:331
T value
The argument value.
Definition arg_wrappers.hpp:339
constexpr num_elements(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:341
T value
The argument value.
Definition arg_wrappers.hpp:349
constexpr offset(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:351
T value
The argument value.
Definition arg_wrappers.hpp:369
constexpr start_channel(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:371
constexpr start_offset(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:381
T value
The argument value.
Definition arg_wrappers.hpp:379
T value
The argument value.
Definition arg_wrappers.hpp:359
constexpr start(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:361
constexpr stop(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:391
T value
The argument value.
Definition arg_wrappers.hpp:389
constexpr threshold(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:401
T value
The argument value.
Definition arg_wrappers.hpp:399
constexpr tick_index(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:411
T value
The argument value.
Definition arg_wrappers.hpp:409
T value
The argument value.
Definition arg_wrappers.hpp:419
constexpr time_window(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:421
constexpr truncate(T arg)
Construct by wrapping a value.
Definition arg_wrappers.hpp:431
T value
The argument value.
Definition arg_wrappers.hpp:429