libtcspc.CheckAlternating

final class libtcspc.CheckAlternating(event0_type, event1_type)[source]

Bases: Node

Pass-through processor that checks two event types alternate.

Verifies that events of types event0_type and event1_type appear in strict alternation starting with event0_type. On violation, a WarningEvent is emitted just before the offending event. All events (including warnings) are then passed through.

Parameters:
  • event0_type (EventType) – The event type expected first in each alternation.

  • event1_type (EventType) – The event type expected to follow event0_type.

Notes

Events handled:

  • event0_type, event1_type: if not strictly alternating starting with event0_type, emit WarningEvent just before passing through.

  • All other event types: pass through unchanged.

  • End of input: pass through.

The output event set always includes WarningEvent, even if the upstream event set does not.

See also

tcspc::check_alternating()

The underlying C++ factory function.