Represents an event.

Namespace: TeaTime
Assembly: DiscreteLogics.TeaFiles (in DiscreteLogics.TeaFiles.dll) Version: 1.0.0.16 (1.0.0.16)

Syntax

public struct Event<T>
where T : struct, new()

Type Parameters

T
The type of the event value.

Remarks

An event describes a value at a certain time. This value might be an observation like the temperature in Costa Rica, the price of a transaction or an assumed value like number of people waiting in a queue computed by a simulation. Such value might be represented by a scalar value, like a Double for a temperature or require a structured value like a "Tick" holding price and volume. While the type of such value differs, ab evene always associates it with a time value. This class abstracts this time property.

Instead of using

CopyC#
struct Tick
{
    [EventTime]
    public Time Time;
    public double Price;
    public int Volume;
}
Event<T> allows to abbreviate
CopyC#
struct Tick
{
    public double Price;
    public int Volume;
}
// and then use
Event<Tick>
This has several advantages: Processing frameworks can isolate the value from Event<(Of <(<'T>)>)> or construct timestamped instances from values.The fact that a type is an event is made explicit in codeIt is shorted to write, EventTimeAttribute is packed into Event<(Of <(<'T>)>)>,The type used for time repressentation is encapsulated in a single class.

See Also