libtcspc.EventType¶
- class libtcspc.EventType[source]¶
Bases:
ABCOpaque marker for the type of events carried on a graph edge.
An
EventTypeinstance is a type tag, not a data carrier. Each concrete subclass corresponds to a C++ event type innamespace tcspc; an instance describes a particular instantiation of that C++ type (for example, parameterised byNumericTraits) and is used by the codegen layer to determine the C++ types flowing on each graph edge.EventTypeitself is abstract; instantiate one of its concrete subclasses. To declare a simple marker event of your own, useCustomEvent.- value(**fields)[source]¶
Construct a concrete event value of this type.
- Parameters:
**fields (int or float or str or array-like) – The value of each field of the event (see the event type’s
Notes). All fields must be given, as concrete ints, floats, or strings matching the type of each field. A bucket field takes a 1-D array-like; it is stored as a read-only copy. A NumPy array is accepted if its dtype matches the field’s dtype exactly or can be safely cast to it; other array-likes (such as lists of ints) are converted (and value-checked) vianumpy.array.- Returns:
The concrete event value, carrying this
EventType.- Return type: