Table of Contents

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

capacity int

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

old DTable<TKey, TValue>
toRemove int

the index of the entry to remove

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

old DTable<TKey, TValue>
key TKey
value TValue

DTable(TKey, TValue)

Special constructor for a new array with a single, first, entry

public DTable(TKey key, TValue value)

Parameters

key TKey
value TValue

Fields

count

public volatile int count

Field Value

int

keys

public readonly TKey[] keys

Field Value

TKey[]

values

public readonly TValue[] values

Field Value

TValue[]