libtcspc.UnbatchFromBytes¶
- final class libtcspc.UnbatchFromBytes(event_type)[source]¶
Bases:
NodeProcessor that emits typed events one-at-a-time from batches of bytes.
Input is a
BucketEventof bytes. The incoming bytes are interpreted as a contiguous stream ofevent_typeand emitted individually (after copying for alignment if needed). Trailing bytes that do not form a wholeevent_typeare buffered and combined with subsequent input.- Parameters:
event_type (EventType) – Element type emitted. Must be a trivially-typed event.
Notes
Events handled:
BucketEventof byte event type: each contained event is emitted one at a time.All other event types: rejected at graph build time.
End of input: pass through. Raises an exception if any unconsumed bytes remain.
See also
- tcspc::unbatch_from_bytes()
The underlying C++ factory function.
BatchFromBytesThe inverse: copy batches of bytes into batches of typed events.