public SequenceWindow Store(SequenceId value) { var latest = Latest; var historyArray = this.historyArray; int difference = Latest - value; if (difference > 0) { historyArray = this.historyArray.Store(difference - 1); } else { int offset = -difference; historyArray = (this.historyArray << offset).Store(offset - 1); latest = value; } return(new SequenceWindow(latest, historyArray)); }
private SequenceWindow(SequenceId latest, BitArray64 history) { Debug.Assert(latest.IsValid); Latest = latest; historyArray = history; }
public SequenceWindow(SequenceId latest) { Debug.Assert(latest.IsValid); Latest = latest; historyArray = new BitArray64(); }