Defines the field of a struct holding the event time.

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

Syntax

[AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)]
public sealed class EventTimeAttribute : Attribute

Remarks

An event describes a value at a certain time. This can be represented by a struct holding the properties of the value and an additional time value. The prefered way to add such time value is to use Event<(Of <(<'T>)>)>. Alternatively, a struct can hold the value and the time value together. Preferred: use Event{T}
CopyC#
struct Tick
{
    public double Price;
    public int Volume;
}
Event<Tick><br></br>
Alternative:
CopyC#
struct Tick2
{
    public Time Time;
    public double Price;
    public int Volume;
}
In the latter case, Tick2 holds a field of type Time. This API assumes that the first Time value in a type used for TeaFiles is the event time. Due to this implicit assumption, the EventTimeAttribute is not necessary in this case. If however more than a single field holds a Time field and not the first field shall be the event time, then putting this attribute on the event time field allows to express that.

Examples

CopyC#
struct FeedMeasurement
{
    public Time Time;
    public double Price;
    public int Volume;
    [EventTime]
    public Time ArrivalTime;
}
In this example, the arrival time it the time at which an event, already holding the time stamp of a distant clock, arrives on the local machine, where it gets the time stamp of the local clock into its field ArrivalTime. The latter shall be the event time. To declare this, the EventTimeAttribute must be applied to the field.

See Also