Beispiel #1
0
            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.");
                }
            }
Beispiel #2
0
            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);
                }
            }
Beispiel #3
0
 public ImmutableHashSet <T> Value(ORSet <T> crdt) => crdt.Value;
Beispiel #4
0
 public ORCart(ORSet <ORCartEntry <T> > inner)
 {
     this.inner = inner;
 }