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

Description

Processors for filtering events.

Functions

template<typename GatedEventList, typename OpenEvent, typename CloseEvent, typename Downstream>
auto tcspc::gate (arg::initially_open< bool > initially_open, Downstream downstream)
 Create a processor that gates events depending on current state.
template<typename EventList, typename Downstream>
auto tcspc::select (Downstream downstream)
 Create a processor that passes a given set of events and discards others.
template<typename Downstream>
auto tcspc::select_all (Downstream downstream)
 Create a processor that passes all events.
template<typename Downstream>
auto tcspc::select_none (Downstream downstream)
 Create a processor that passes no events.
template<typename EventList, typename Downstream>
auto tcspc::select_not (Downstream downstream)
 Create a processor that discards a given set of events and passes others.

Function Documentation

◆ gate()

template<typename GatedEventList, typename OpenEvent, typename CloseEvent, typename Downstream>
auto tcspc::gate ( arg::initially_open< bool > initially_open,
Downstream downstream )

Create a processor that gates events depending on current state.

The processor keeps an internal boolean state: the gate. The initial state of the gate is determined by initially_open. When an OpenEvent is received, the gate is opened. When a CloseEvent is received, the gate is closed.

Events belonging to GatedEventList are gated: they are passed through if and only if the gate is currently open.

All events not in GatedEventList are passed through (including OpenEvent and CloseEvent).

Template Parameters
GatedEventListevent types to gate
OpenEventevent type that opens the gate
CloseEventevent type that closes the gate
Downstreamdownstream processor type
Parameters
initially_openwhether the gate is open before the first OpenEvent or CloseEvent event is received
downstreamdownstream processor
Returns
processor
Events handled
  • OpenEvent: open the gate; pass through
  • CloseEvent: close the gate; pass through
  • Types in GatedEventList: pass through if gate open; otherwise no action
  • All other types: pass through with no action
  • Flush: pass through with no action

◆ select()

template<typename EventList, typename Downstream>
auto tcspc::select ( Downstream downstream)

Create a processor that passes a given set of events and discards others.

Template Parameters
EventListevent types to pass
Downstreamdownstream processor type
Parameters
downstreamdownstream processor
Returns
processor
Events handled
  • Types in EventList: pass through with no action
  • Types not in EventList: ignore
  • Flush: pass through with no action

◆ select_all()

template<typename Downstream>
auto tcspc::select_all ( Downstream downstream)

Create a processor that passes all events.

In other words, this is a no-op processor.

Template Parameters
Downstreamdownstream processor type
Parameters
downstreamdownstream processor
Returns
processor
Events handled
  • All types: pass through with no action
  • Flush: pass through with no action

◆ select_none()

template<typename Downstream>
auto tcspc::select_none ( Downstream downstream)

Create a processor that passes no events.

The processor does pass end-of-stream, so can be used as a way to detect the end of the stream.

Template Parameters
Downstreamdownstream processor type
Parameters
downstreamdownstream processor
Returns
processor
Events handled
  • All types: ignore
  • Flush: pass through with no action

◆ select_not()

template<typename EventList, typename Downstream>
auto tcspc::select_not ( Downstream downstream)

Create a processor that discards a given set of events and passes others.

Template Parameters
EventListevent types to discard
Downstreamdownstream processor type
Parameters
downstreamdownstream processor
Returns
processor
Events handled
  • Types in EventList: ignore
  • Types not in EventList: pass through with no action
  • Flush: pass through with no action