libtcspc C++ API
Streaming TCSPC and time tag data processing
Loading...
Searching...
No Matches
tcspc::unique_bin_mapper< NumericTraits > Class Template Reference

Description

template<typename NumericTraits = default_numeric_traits>
class tcspc::unique_bin_mapper< NumericTraits >

Bin mapper that maps unique datapoints to consecutive bin indices.

This is intended for use with datapoints that only have a small number of unique values (for example, those from tcspc::channel_data_mapper).

Each datapoint value is mapped to a bin index starting from 0, assigned in the order in which the value is encountered.

The datapoint values for each bin index can later be retrieved via the context.

Template Parameters
NumericTraitsnumeric traits specifying datapoint_type and bin_index_type.

Public Member Functions

 unique_bin_mapper (access_tracker< unique_bin_mapper_accessor< typename NumericTraits::datapoint_type > > &&tracker, arg::max_bin_index< typename NumericTraits::bin_index_type > max_bin_index)
 Construct with context and parameter.
auto n_bins () const -> std::size_t
 Implements bin mapper requirement.
auto operator() (NumericTraits::datapoint_type datapoint) -> std::optional< typename NumericTraits::bin_index_type >
 Implements bin mapper requirement.

Constructor & Destructor Documentation

◆ unique_bin_mapper()

template<typename NumericTraits = default_numeric_traits>
tcspc::unique_bin_mapper< NumericTraits >::unique_bin_mapper ( access_tracker< unique_bin_mapper_accessor< typename NumericTraits::datapoint_type > > && tracker,
arg::max_bin_index< typename NumericTraits::bin_index_type > max_bin_index )
inlineexplicit

Construct with context and parameter.

Parameters
trackeraccess tracker for later access of the datapoint values
max_bin_indexnumber of bins minus one (must not be negative)

The documentation for this class was generated from the following file: