libtcspc.BatchFromBytes

final class libtcspc.BatchFromBytes(event_type, *, buffer_provider=None)[source]

Bases: Node

Processor that copies batches of bytes into batches of typed events.

Input is a BucketEvent of an internal byte event type (std::byte). The processor copies the incoming bytes into a fresh BucketEvent of event_type, drawing storage from the buffer provider. Any trailing bytes that do not make up a whole event_type are buffered and combined with subsequent input.

Parameters:

Notes

Events handled:

  • BucketEvent of byte event type: copy up to object boundary as BucketEvent of event_type; emit.

  • 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::batch_from_bytes()

The underlying C++ factory function.

UnbatchFromBytes

The inverse: emit typed events one at a time from byte batches.

ViewAsBytes

View bucketed events as their in-memory bytes.