libtcspc.EventType

class libtcspc.EventType[source]

Bases: ABC

Opaque marker for the type of events carried on a graph edge.

An EventType instance is a type tag, not a data carrier. Each concrete subclass corresponds to a C++ event type in namespace tcspc; an instance describes a particular instantiation of that C++ type (for example, parameterised by NumericTraits) and is used by the codegen layer to determine the C++ types flowing on each graph edge.

EventType itself is abstract; instantiate one of its concrete subclasses. To declare a simple marker event of your own, use CustomEvent.

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) via numpy.array.

Returns:

The concrete event value, carrying this EventType.

Return type:

EventInstance