|
libtcspc C++ API
Streaming TCSPC and time tag data processing
|
Processors for collecting statistics.
Functions | |
| template<typename Event, typename Downstream> | |
| auto | tcspc::count (access_tracker< count_accessor > &&tracker, Downstream downstream) |
| Create a processor that counts events of a given type. | |
| template<typename NumericTraits = default_numeric_traits, typename Downstream> | |
| auto | tcspc::record_abstime_range (access_tracker< record_abstime_range_accessor< typename NumericTraits::abstime_type > > &&tracker, Downstream downstream) |
| Create a processor that records the range of abstime observed. | |
| template<typename Event, typename Downstream> | |
| auto | tcspc::record_last (access_tracker< record_last_accessor< Event > > &&tracker, Downstream downstream) |
| Create a processor that remembers the last event of a given type. | |
| auto tcspc::count | ( | access_tracker< count_accessor > && | tracker, |
| Downstream | downstream ) |
Create a processor that counts events of a given type.
The count can be retrieved through a tcspc::count_accessor retrieved from the tcspc::context from which tracker was obtained.
Note that the count is incremented before the events of type Event are sent to the downstream processor. This means that the event will be counted even if it subsequently results in an error or end-of-stream in a downstream processor.
| Event | type of event to count |
| Downstream | downstream processor type (usually deduced) |
| tracker | access tracker for later access of the count result |
| downstream | downstream processor |
| auto tcspc::record_abstime_range | ( | access_tracker< record_abstime_range_accessor< typename NumericTraits::abstime_type > > && | tracker, |
| Downstream | downstream ) |
Create a processor that records the range of abstime observed.
The processor passes through all events. It examines events that have an abstime field and tracks the minimum and maximum abstime observed. The event's abstime field type must match NumericTraits::abstime_type.
The minimum and maximum can be retrieved through a tcspc::record_abstime_range_accessor retrieved from the tcspc::context from which tracker was obtained. Each is empty (std::nullopt) until an abstime-stamped event has been observed.
| NumericTraits | numeric traits specifying abstime_type |
| Downstream | downstream processor type (usually deduced) |
| tracker | access tracker for later access of the abstime range result |
| downstream | downstream processor |
| auto tcspc::record_last | ( | access_tracker< record_last_accessor< Event > > && | tracker, |
| Downstream | downstream ) |
Create a processor that remembers the last event of a given type.
The processor passes through all events. It retains a copy of the last event of type Event that passed through.
The retained event can be retrieved through a tcspc::record_last_accessor obtained from the tcspc::context from which tracker was obtained. It is empty (std::nullopt) until an event of type Event has been observed.
Because the processor stores a copy of every event of the requested type that passes through (and retrieval via the accessor also returns a copy), it is best suited to events that are cheap to copy and that occur infrequently — most naturally a single result event such as a tcspc::concluding_histogram_event.
| Event | the event type to remember (must be specified explicitly) |
| Downstream | downstream processor type (usually deduced) |
| tracker | access tracker for later access of the recorded event |
| downstream | downstream processor |