public ORSet <T> Effect(ORSet <T> crdt, object operation, DurableEvent e) { switch (operation) { case AddOp add: return(crdt.Add((T)add.Entry, e.VectorTimestamp)); case RemoveOp rem: return(crdt.Remove(rem.Timestamps)); default: throw new NotSupportedException($"ORSet doesn't support [{operation.GetType().FullName}] operation."); } }
public object Prepare(ORSet <T> crdt, object operation) { switch (operation) { case RemoveOp rem: var timestamps = crdt.PrepareRemove((T)rem.Entry); if (timestamps.IsEmpty) { return(null); } else { return(new RemoveOp(rem.Entry, timestamps)); } default: return(operation); } }
public ImmutableHashSet <T> Value(ORSet <T> crdt) => crdt.Value;
public ORCart(ORSet <ORCartEntry <T> > inner) { this.inner = inner; }