libtcspc.Count

final class libtcspc.Count(event_type, access_tag)[source]

Bases: Node

Processor that counts events of a given type, passing every event through.

The running count can be retrieved at any time during execution via the CountAccess retrieved from the ExecutionContext using access_tag. The counter is incremented before each matching event is forwarded, so an observer reading the count immediately after the Nth matching event sees the value N.

Parameters:

Notes

Events handled:

  • Events matching event_type: increment counter, then pass through.

  • All other event types: pass through unchanged.

  • End of input: pass through.

See also

tcspc::count()

The underlying C++ factory function.