libtcspc.MatchAndConsume

final class libtcspc.MatchAndConsume(event_type, out_event_type, matcher)[source]

Bases: Node

Processor that emits an output event for each matched event, consuming matches.

Like Match, but matched events are not passed through (consumed); only unmatched events of event_type and other events pass through.

Parameters:
  • event_type (EventType) – The event type tested by the matcher.

  • out_event_type (EventType) – The event type emitted on a match. Must be constructible from an abstime.

  • matcher (Matcher) – The matcher deciding which events match.

Notes

Events handled:

  • event_type matched by the matcher: emit an out_event_type constructed from the matched event’s abstime; the matched event is consumed (not passed through).

  • All other input events (including unmatched event_type): pass through unchanged.

  • End of input: pass through.

See also

tcspc::match_and_consume()

The underlying C++ factory function.

Match

Like MatchAndConsume, but matched events are also passed through.