コード例 #1
0
ファイル: ORSet.cs プロジェクト: lulzzz/Eventuate.NET
            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.");
                }
            }
コード例 #2
0
ファイル: ORSet.cs プロジェクト: lulzzz/Eventuate.NET
            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);
                }
            }
コード例 #3
0
ファイル: ORSet.cs プロジェクト: lulzzz/Eventuate.NET
 public ImmutableHashSet <T> Value(ORSet <T> crdt) => crdt.Value;
コード例 #4
0
ファイル: ORCart.cs プロジェクト: lulzzz/Eventuate.NET
 public ORCart(ORSet <ORCartEntry <T> > inner)
 {
     this.inner = inner;
 }