libtcspc.ConstBucketEvent

class libtcspc.ConstBucketEvent(element_type)[source]

Bases: EventType

Event carrying a read-only contiguous array of elements of another event type.

Emitted by sources that deliver real-time, read-only views of partial buckets — for example, the live output of AcquireFullBuckets. The view co-owns its backing storage and must not be modified.

Parameters:

element_type (EventType) – The event type of the elements stored in the bucket.

Notes

The corresponding C++ event is tcspc::bucket<T const>, a movable handle to a contiguous storage region that is read-only and may be shared with its owner. This is a distinct type from BucketEvent (tcspc::bucket<T>).

This is the event type to use when feeding bulk data into a graph from Python (for example, as the input to CopyToBuckets or CopyToFullBuckets): a numpy array or other buffer-protocol object pushed into a graph input declared as ConstBucketEvent is wrapped zero-copy as a read-only bucket. Pushing data in as a BucketEvent (writable) is not supported, because sole ownership of a Python buffer cannot be guaranteed.

See also

tcspc::bucket

The underlying C++ bucket type.

BucketEvent

The writable counterpart (tcspc::bucket<T>).