Table of Contents

Class CachingConcurrentDictionary<TKey, TValue>

Namespace
Vintagestory.API.Datastructures
Assembly
VintagestoryAPI.dll

Exactly like ConcurrentDictionary except that Values is cached for performance, instead of building a new List each time Values is accessed

The cache is only guaranteed up to date if CachedConcurrentDictionary.TryAdd, .TryRemove or [] methods are used to modify the Dictionary otherwise the cache will be updated next time when one of those methods is used

public class CachingConcurrentDictionary<TKey, TValue> : ConcurrentDictionary<TKey, TValue>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable

Type Parameters

TKey
TValue
Inheritance
ConcurrentDictionary<TKey, TValue>
CachingConcurrentDictionary<TKey, TValue>
Implements
IDictionary<TKey, TValue>
ICollection<KeyValuePair<TKey, TValue>>
IReadOnlyDictionary<TKey, TValue>
IEnumerable<KeyValuePair<TKey, TValue>>
Inherited Members
Extension Methods

Properties

this[TKey]

public TValue this[TKey key] { get; set; }

Parameters

key TKey

Property Value

TValue

Values

public ICollection<TValue> Values { get; }

Property Value

ICollection<TValue>

Methods

TryAdd(TKey, TValue)

public bool TryAdd(TKey key, TValue value)

Parameters

key TKey
value TValue

Returns

bool

TryRemove(TKey, out TValue)

public bool TryRemove(TKey key, out TValue value)

Parameters

key TKey
value TValue

Returns

bool