Ejemplo n.º 1
0
        public PNCounterDictionary <TKey> MergeDelta(ORDictionary <TKey, PNCounter> .IDeltaOperation delta)
        {
            switch (delta)
            {
            case PNCounterDictionaryDelta d:
                return(new PNCounterDictionary <TKey>(Underlying.MergeDelta(d.Underlying)));

            default:
                return(new PNCounterDictionary <TKey>(Underlying.MergeDelta(delta)));
            }
        }
Ejemplo n.º 2
0
 public ORMultiValueDictionary <TKey, TValue> MergeDelta(ORDictionary <TKey, ORSet <TValue> > .IDeltaOperation delta)
 {
     if (_withValueDeltas)
     {
         return(new ORMultiValueDictionary <TKey, TValue>(Underlying.MergeDeltaRetainingDeletedValues(delta), _withValueDeltas));
     }
     else
     {
         return(new ORMultiValueDictionary <TKey, TValue>(Underlying.MergeDelta(delta), _withValueDeltas));
     }
 }
Ejemplo n.º 3
0
 public PNCounterDictionaryDelta(ORDictionary <TKey, PNCounter> .IDeltaOperation underlying)
 {
     Underlying = underlying;
     if (underlying is IReplicatedDeltaSize s)
     {
         DeltaSize = s.DeltaSize;
     }
     else
     {
         DeltaSize = 1;
     }
 }
Ejemplo n.º 4
0
 public ORMultiValueDictionaryDelta(ORDictionary <TKey, ORSet <TValue> > .IDeltaOperation underlying)
 {
     Underlying = underlying;
     if (underlying is IReplicatedDeltaSize s)
     {
         DeltaSize = s.DeltaSize;
     }
     else
     {
         DeltaSize = 1;
     }
 }
            public bool Equals(ORDictionary <TKey, ORSet <TValue> > .IDeltaOperation other)
            {
                if (other is ORDictionary <TKey, ORSet <TValue> > .DeltaGroup group)
                {
                    if (Underlying is ORDictionary <TKey, ORSet <TValue> > .DeltaGroup ourGroup)
                    {
                        return(ourGroup.Operations.SequenceEqual(group.Operations));
                    }

                    if (group.Operations.Length == 1)
                    {
                        return(Underlying.Equals(group.Operations.First()));
                    }

                    return(false);
                }
                return(Underlying.Equals(other));
            }
Ejemplo n.º 6
0
 public PNCounterDictionary(ORDictionary <TKey, PNCounter> underlying)
 {
     _underlying = underlying;
 }
Ejemplo n.º 7
0
 public PNCounterDictionary <TKey> MergeDelta(ORDictionary <TKey, PNCounter> .IDeltaOperation delta) =>
 new PNCounterDictionary <TKey>(_underlying.MergeDelta(delta));
 internal ORMultiValueDictionary(ORDictionary <TKey, ORSet <TValue> > underlying, bool withValueDeltas)
 {
     Underlying       = underlying;
     _withValueDeltas = withValueDeltas;
 }
Ejemplo n.º 9
0
 public ORMultiDictionary(ORDictionary<TKey, ORSet<TValue>> underlying)
 {
     _underlying = underlying;
 }