libtcspc C++ API
Streaming TCSPC and time tag data processing
Loading...
Searching...
No Matches
Validation processors

Description

Processors for data validation.

Functions

template<typename Event0, typename Event1, typename Downstream>
auto tcspc::check_alternating (Downstream downstream)
 Create a processor that checks that events of two types appear in alternation.
template<typename DataTypes = default_data_types, bool RequireStrictlyIncreasing = false, typename Downstream>
auto tcspc::check_monotonic (Downstream downstream)
 Create a processor that checks that abstime is monotonically increasing or nondecreasing.

Function Documentation

◆ check_alternating()

template<typename Event0, typename Event1, typename Downstream>
auto tcspc::check_alternating ( Downstream downstream)

Create a processor that checks that events of two types appear in alternation.

The processor passes through all events. It examines events of types Event0 and Event1, and checks that they alternate, starting with Event0. If a violation is detected, a tcspc::warning_event is emitted just before the offending event.

Template Parameters
Event0event type expected first
Event1event type expected second
Downstreamdownstream processor type (usually deduced)
Parameters
downstreamdownstream processor
Returns
processor
Events handled
  • Event0, Event1: if not strictly alternating, starting with Event0, emit tcspc::warning_event; pass through
  • All other types: pass through with no action
  • Flush: pass through with no action

◆ check_monotonic()

template<typename DataTypes = default_data_types, bool RequireStrictlyIncreasing = false, typename Downstream>
auto tcspc::check_monotonic ( Downstream downstream)

Create a processor that checks that abstime is monotonically increasing or nondecreasing.

The processor passes through time-tagged events and checks that their abstime is monotonic (that is, increasing or non-decreasing). The event's abstime field type must match DataTypes::abstime_type. If a violation is detected, a tcspc::warning_event is emitted just before the offending event.

Checking abstime monotonicity is often a good way to detect gross issues in the data, such as reading data in an incorrect format or using text mode to read binary data.

Template Parameters
DataTypesdata type set specifying abstime_type
RequireStrictlyIncreasingif true, issue warning also on equal abstime
Downstreamdownstream processor type (usually deduced)
Parameters
downstreamdownstream processor
Returns
processor
Events handled
  • All types with abstime field: check monotonicity and emit tcspc::warning_event on violation; pass through
  • All other types: pass through with no action
  • Flush: pass through with no action