libtcspc.Gate

final class libtcspc.Gate(*gated_event_types, open_event_type, close_event_type, initially_open=False)[source]

Bases: Node

Pass-through processor that gates events depending on open/close state.

Maintains a boolean gate. When an open_event_type is received the gate opens; when a close_event_type is received it closes. Events of the gated types are passed through only while the gate is open; all other events (including the open and close events) always pass through.

Parameters:
  • *gated_event_types (EventType) – Event types to gate.

  • open_event_type (EventType, keyword-only) – Event type that opens the gate.

  • close_event_type (EventType, keyword-only) – Event type that closes the gate.

  • initially_open (bool or Param[bool], keyword-only) – Initial state of the gate. Default False.

Notes

Events handled:

  • Events in gated_event_types: passed through only while open.

  • open_event_type / close_event_type: open/close the gate and pass through.

  • All other event types: pass through unchanged.

  • End of input: pass through.

See also

tcspc::gate()

The underlying C++ factory function.