Table of Contents

Struct EnqueuedEvent<TEvent, TPoint, TPointDelta>

Namespace
LfrlAnvil.Reactive.Queues.Composites
Assembly
LfrlAnvil.Reactive.Queues.dll

Represents an event enqueued in the IEventQueue<TEvent, TPoint, TPointDelta>.

public readonly struct EnqueuedEvent<TEvent, TPoint, TPointDelta>

Type Parameters

TEvent

Event type.

TPoint

Queue point type.

TPointDelta

Queue point delta type.

Inherited Members

Properties

Delta

Point delta used for moving DequeuePoint forward on each repetition of this event.

public TPointDelta? Delta { get; }

Property Value

TPointDelta

DequeuePoint

Queue point at which this event should be dequeued.

public TPoint DequeuePoint { get; }

Property Value

TPoint

Event

Underlying event.

public TEvent Event { get; }

Property Value

TEvent

IsInfinite

Specifies whether or not this event repeats infinitely.

public bool IsInfinite { get; }

Property Value

bool

Repetitions

Number of repetitions of this event.

public int Repetitions { get; }

Property Value

int

Methods

AsInfinite()

Creates a new EnqueuedEvent<TEvent, TPoint, TPointDelta> instance that repeats infinitely.

[Pure]
public EnqueuedEvent<TEvent, TPoint, TPointDelta> AsInfinite()

Returns

EnqueuedEvent<TEvent, TPoint, TPointDelta>

New EnqueuedEvent<TEvent, TPoint, TPointDelta> instance.

Create(TEvent, TPoint, TPointDelta, int)

Creates a new EnqueuedEvent<TEvent, TPoint, TPointDelta> instance that repeats specified number of times.

[Pure]
public static EnqueuedEvent<TEvent, TPoint, TPointDelta> Create(TEvent @event, TPoint dequeuePoint, TPointDelta delta, int repetitions)

Parameters

event TEvent

Underlying event.

dequeuePoint TPoint

Queue point at which this event should be dequeued for the first time.

delta TPointDelta

Point delta used for moving DequeuePoint forward on each repetition of this event.

repetitions int

Number of repetitions.

Returns

EnqueuedEvent<TEvent, TPoint, TPointDelta>

New EnqueuedEvent<TEvent, TPoint, TPointDelta> instance.

Exceptions

ArgumentOutOfRangeException

When repetitions is less than 1.

CreateInfinite(TEvent, TPoint, TPointDelta)

Creates a new EnqueuedEvent<TEvent, TPoint, TPointDelta> instance that repeats infinitely.

[Pure]
public static EnqueuedEvent<TEvent, TPoint, TPointDelta> CreateInfinite(TEvent @event, TPoint dequeuePoint, TPointDelta delta)

Parameters

event TEvent

Underlying event.

dequeuePoint TPoint

Queue point at which this event should be dequeued for the first time.

delta TPointDelta

Point delta used for moving DequeuePoint forward on each repetition of this event.

Returns

EnqueuedEvent<TEvent, TPoint, TPointDelta>

New EnqueuedEvent<TEvent, TPoint, TPointDelta> instance.

CreateSingle(TEvent, TPoint)

Creates a new EnqueuedEvent<TEvent, TPoint, TPointDelta> instance that happens exactly once.

[Pure]
public static EnqueuedEvent<TEvent, TPoint, TPointDelta> CreateSingle(TEvent @event, TPoint dequeuePoint)

Parameters

event TEvent

Underlying event.

dequeuePoint TPoint

Queue point at which this event should be dequeued.

Returns

EnqueuedEvent<TEvent, TPoint, TPointDelta>

New EnqueuedEvent<TEvent, TPoint, TPointDelta> instance.

ToString()

Returns a string representation of this EnqueuedEvent<TEvent, TPoint, TPointDelta> instance.

[Pure]
public override string ToString()

Returns

string

String representation.

WithDelta(TPointDelta)

Creates a new EnqueuedEvent<TEvent, TPoint, TPointDelta> instance with changed Delta.

[Pure]
public EnqueuedEvent<TEvent, TPoint, TPointDelta> WithDelta(TPointDelta delta)

Parameters

delta TPointDelta

Point delta used for moving DequeuePoint forward on each repetition of this event.

Returns

EnqueuedEvent<TEvent, TPoint, TPointDelta>

New EnqueuedEvent<TEvent, TPoint, TPointDelta> instance.

WithDequeuePoint(TPoint)

Creates a new EnqueuedEvent<TEvent, TPoint, TPointDelta> instance with changed DequeuePoint.

[Pure]
public EnqueuedEvent<TEvent, TPoint, TPointDelta> WithDequeuePoint(TPoint dequeuePoint)

Parameters

dequeuePoint TPoint

Next queue point at which this event should be dequeued.

Returns

EnqueuedEvent<TEvent, TPoint, TPointDelta>

New EnqueuedEvent<TEvent, TPoint, TPointDelta> instance.

WithRepetitions(int)

Creates a new EnqueuedEvent<TEvent, TPoint, TPointDelta> instance with changed Repetitions.

[Pure]
public EnqueuedEvent<TEvent, TPoint, TPointDelta> WithRepetitions(int repetitions)

Parameters

repetitions int

Number of repetitions.

Returns

EnqueuedEvent<TEvent, TPoint, TPointDelta>

New EnqueuedEvent<TEvent, TPoint, TPointDelta> instance.

Exceptions

ArgumentOutOfRangeException

When repetitions is less than 1.