Example #1
0
        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));
        }
Example #2
0
 private SequenceWindow(SequenceId latest, BitArray64 history)
 {
     Debug.Assert(latest.IsValid);
     Latest       = latest;
     historyArray = history;
 }
Example #3
0
 public SequenceWindow(SequenceId latest)
 {
     Debug.Assert(latest.IsValid);
     Latest       = latest;
     historyArray = new BitArray64();
 }