public EnumerableSurrogate(ReferenceMultiRankMap <KeyType, ValueType> map, bool forward, bool robust, bool startKeyed, KeyType startKey) { this.map = map; this.forward = forward; this.robust = robust; this.startKeyed = startKeyed; this.startKey = startKey; }
public void ConditionalSetOrRemove(KeyType key, UpdatePredicate <KeyType, ValueType> predicate) { if (predicate == null) { throw new ArgumentNullException(); } ValueType value; bool resident = TryGetValue(key, out value); uint version = inner.version; ReferenceMultiRankMap <KeyType, ValueType> savedInner = inner; inner = new ReferenceMultiRankMap <KeyType, ValueType>(); inner.version = savedInner.version; bool remove = predicate(key, ref value, resident); savedInner.version = inner.version; inner = savedInner; if (version != inner.version) { throw new InvalidOperationException(); } if (resident) { if (remove) { bool f = TryRemove(key); Debug.Assert(f); } else { bool f = TrySetValue(key, value); Debug.Assert(f); } } }
public ReferenceMultiRankMap(ReferenceMultiRankMap <KeyType, ValueType> original) { items.AddRange(original.items); }
public ReferenceRankMap(ReferenceRankMap <KeyType, ValueType> original) { inner = new ReferenceMultiRankMap <KeyType, ValueType>(original.inner); }