Class DTable<TKey, TValue>
- Namespace
- Vintagestory.Common
- Assembly
- VintagestoryAPI.dll
A single object to allow the arrays in ConcurrentSmallDictionary to be replaced atomically. Keys, once entered in the keys array within a DTable, are invariable: if we ever need to remove a key we will create a new DTable
public class DTable<TKey, TValue>Type Parameters
- TKey
- TValue
- Inheritance
- 
      
      DTable<TKey, TValue>
- Inherited Members
- Extension Methods
Constructors
DTable(int)
public DTable(int capacity)Parameters
- capacityint
DTable(DTable<TKey, TValue>, int)
Special constructor which copies the old arrays and removes one entry
public DTable(DTable<TKey, TValue> old, int toRemove)Parameters
DTable(DTable<TKey, TValue>, TKey, TValue)
Special constructor which copies the old arrays and adds one new entry at the end - all will be atomic when the Dictionary replaces contents with the results of this
public DTable(DTable<TKey, TValue> old, TKey key, TValue value)Parameters
- oldDTable<TKey, TValue>
- keyTKey
- valueTValue
DTable(TKey, TValue)
Special constructor for a new array with a single, first, entry
public DTable(TKey key, TValue value)Parameters
- keyTKey
- valueTValue
Fields
count
public volatile int countField Value
keys
public readonly TKey[] keysField Value
- TKey[]
values
public readonly TValue[] valuesField Value
- TValue[]