public OrSet <T> Updated(OrSet <T> crdt, object operation, DurableEvent e) { if (operation is RemoveOp <T> ) { var remove = (RemoveOp <T>)operation; return(crdt.Remove(remove.Entry, remove.Timestamps)); } if (operation is AddOp <T> ) { var add = (AddOp <T>)operation; return(crdt.Add(add.Entry, e.VectorTimestamp)); } return(crdt); }
public object Updating(OrSet <T> crdt, object operation) { if (operation is RemoveOp <T> ) { var op = (RemoveOp <T>)operation; var timestamps = crdt.PrepareRemove(op.Entry); if (timestamps.Count != 0) { return(new RemoveOp <T>(op.Entry, timestamps)); } return(null); } return(operation); }
public IImmutableSet <T> GetValue(OrSet <T> crdt) { return(crdt.Value.ToImmutableHashSet()); }