public DottedVersionVector(CausalEvent dot, VersionVector v) { Ensure.That(dot, "dot").IsNotNull(); Ensure.That(v, "v").IsNotNull(); _dot = dot; _v = v; }
/// <summary> /// Generates a new clock. /// </summary> public DottedVersionVector Event(VersionVector context, Siblings s, string i) { Ensure.That(s, "s").IsNotNull(); Ensure.That(context, "context").IsNotNull(); Ensure.That(i, "i").IsNotNullOrEmpty(); long maxDot = s.MaxDot(i); long maxCausalHistory = context[i]; long maxCounter = Math.Max(maxDot, maxCausalHistory); var dot = new CausalEvent(i, maxCounter + 1); return(new DottedVersionVector(dot, context)); }
public VersionVector(CausalEvent @event) : this() { _events.Add(@event.I, @event.N); }