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

Description

template<typename DataTypes = default_data_types>
class tcspc::unique_bin_mapper< DataTypes >

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
DataTypesdata type set specifying datapoint_type and bin_index_type.

Public Member Functions

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

Constructor & Destructor Documentation

◆ unique_bin_mapper()

template<typename DataTypes = default_data_types>
tcspc::unique_bin_mapper< DataTypes >::unique_bin_mapper ( access_tracker< unique_bin_mapper_access< typename DataTypes::datapoint_type > > && tracker,
arg::max_bin_index< typename DataTypes::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: