libtcspc.Merge¶
- final class libtcspc.Merge(*event_types, max_buffered=65536, numeric_traits=None)[source]¶
Bases:
NodeMerges two sorted input streams into one, ordered by
abstime.Events arriving on the two inputs are buffered and emitted in non-decreasing
abstimeorder. For events with equalabstime, those frominput-0are emitted before those frominput-1(a guaranteed tie-breaking order).- Parameters:
*event_types (EventType) – The event types to merge. Every event handled must carry an
abstimemember; the merge buffers and sorts by it.max_buffered (int or Param[int]) – The maximum number of events to buffer from a single input before the other input must produce an event. Default: 65536.
numeric_traits (NumericTraits or None) – Set of integer types parameterising the merge (in particular the
abstime_type).None(the default) usesNumericTraitsdefaults.
Notes
The node has two input ports,
"input-0"and"input-1", and a single output port. Both inputs must be fed internally (for example by aRouteorBroadcastthat fans out a single external input); a merge cannot serve as the executable graph’s external input.Both inputs must be driven on the same thread (the underlying C++
mergeshares unsynchronized state across its input ports). This is enforced when the graph is compiled: a merge fed from two threads — for example with aBufferon only one branch — is rejected.Events handled:
Events matching one of
event_types: buffered and emitted in non-decreasingabstimeorder.Events not in
event_types: rejected at graph build time.End of input: flushes any buffered events, then propagates.
See also
- tcspc::merge()
The underlying C++ factory function.
MergeNN-way sorted merge without the equal-
abstimetie-breaking guarantee.MergeNUnsortedN-way pass-through merge that does no sorting or buffering.