Interface IL2OrderBookWriter<A, L>
- Namespace
- Virtufin.Base.OrderBooks
- Assembly
- Virtufin.Base.dll
Mutable surface of an IL2OrderBook<A, L>, used by Level2OrderBookUpdater<TBook, A, L, S, D>. Kept separate from the read-only Core trait so consumers of a book cannot mutate it by accident.
public interface IL2OrderBookWriter<A, L> where A : IFixedPointAmount where L : IFixedPointAmount
Type Parameters
ADepth (size) amount type.
LLevel (price) amount type.
Properties
AppliedFinalUpdateId
Final update id of the most recently applied diff, or -1.
long AppliedFinalUpdateId { get; }
Property Value
AppliedFirstUpdateId
First update id of the most recently applied diff, or -1.
long AppliedFirstUpdateId { get; }
Property Value
LastUpdateId
The last applied update id (or the bootstrapping snapshot's id).
long LastUpdateId { get; }
Property Value
State
Current lifecycle state.
OrderBookState State { get; }
Property Value
Methods
ApplyLevel(bool, L, A)
Apply one level mutation: a zero size removes the price, otherwise the size is assigned (absolute, not incremental).
void ApplyLevel(bool isBid, L price, A size)
Parameters
isBidbooltruefor the bid side,falsefor asks.priceLLevel price.
sizeANew aggregate size; zero removes the level.
Clear()
Remove every level.
void Clear()
ResetAppliedRange()
Clear the recorded applied id range (e.g. after a snapshot).
void ResetAppliedRange()
SetAppliedRange(long, long)
Record the id range of the most recently applied diff.
void SetAppliedRange(long firstUpdateId, long finalUpdateId)
Parameters
SetLastUpdateId(long)
Set the last applied update id.
void SetLastUpdateId(long lastUpdateId)
Parameters
lastUpdateIdlongNew update id.
SetState(OrderBookState)
Set the lifecycle state.
void SetState(OrderBookState state)
Parameters
stateOrderBookStateNew state.