Aardvark.Base


ConcurrentBigDict<'TKey, 'TValue>

A ConcurrentBigDict is an alternate implementation of a Dictionary that can optionally act as a stack for all items with the same key. It is implemented as a hashtable with external linking, that uses primes as the table size in order to reduce the danger of funneling.

Constructors

ConstructorDescription
new(dict)
Signature: dict:BigDict<'TKey,'TValue> -> unit

A ConcurrentBigDict can only be concstructed by wrapping its non-concurrent counterpart.

Instance members

Instance memberDescription
Add(key, value)
Signature: (key:'TKey * value:'TValue) -> unit

Add the item with the supplied key and the supplied value to the ConcurrentBigDict.

Add(key, hash, value)
Signature: (key:'TKey * hash:int64 * value:'TValue) -> unit

Add the item with the supplied key and the supplied value to the ConcurrentBigDict.

Add(item)
Signature: item:KeyValuePair<'TKey,'TValue> -> unit

Add the supplied item to the ConcurrentBigDict.

AddObject(objkey, objvalue)
Signature: (objkey:obj * objvalue:obj) -> unit

Add the item with supplied key and the supplied value both supplied as generic objects, to the ConcurrentBigDict. Note that the supplied key and value are cast to the concrete type of the keys and values used in the ConcurrentBigDict and this will fail if they are of different types.

AddRange(items)
Signature: items:IEnumerable<KeyValuePair<'TKey,'TValue>> -> unit

Add the supplied items to the ConcurrentBigDict.

Clear()
Signature: unit -> unit

Remove all items. Capacity remains unchanged.

Contains(key)
Signature: key:'TKey -> bool

Returns true if the ConcurrentBigDict contains the item with the supplied key.

Contains(key, hash)
Signature: (key:'TKey * hash:int64) -> bool

Returns true if the ConcurrentBigDict contains the item with the supplied key.

Contains(key, value)
Signature: (key:'TKey * value:'TValue) -> bool

Returns true if the ConcurrentBigDict contains the item with the supplied key and the supplied value.

Contains(key, hash, value)
Signature: (key:'TKey * hash:int64 * value:'TValue) -> bool

Returns true if the ConcurrentBigDict contains the item with the supplied key and the supplied value.

Contains(item)
Signature: item:KeyValuePair<'TKey,'TValue> -> bool

Returns true if the ConcurrentBigDict contains the item with the supplied KeyValuePair.

ContainsKey(key)
Signature: key:'TKey -> bool

Returns true if the ConcurrentBigDict contains the item with the supplied key.

ContainsKey(key, hash)
Signature: (key:'TKey * hash:int64) -> bool

Returns true if the ConcurrentBigDict contains the item with the supplied key.

CopyKeysTo(array, index)
Signature: (array:'TKey [] * index:int64) -> unit

Copies all keys in the dictionary to the supplied array starting at the supplied index. This may throw a ConcurrentDataModifiedException if data is modified by another task during the operation.

CopyTo(array, index)
Signature: (array:KeyValuePair<'TKey,'TValue> [] * index:int64) -> unit

Copies all KeyValuePairs in the dictionary into the supplied array starting at the supplied index. This may throw a ConcurrentDataModifiedException if data is modified by another task during the operation.

CopyValuesTo(array, index)
Signature: (array:'TValue [] * index:int64) -> unit

Copies all values in the dictionary to the supplied array starting at the supplied index. This may throw a ConcurrentDataModifiedException if data is modified by another task during the operation.

Get(key)
Signature: key:'TKey -> 'TValue

Get the element with the supplied key. Throws an exception if the element is not found. This is an alias of the indexer.

Get(key, defaultValue)
Signature: (key:'TKey * defaultValue:'TValue) -> 'TValue

Get the element with the supplied key. Returns the supplied default value if the element is not found.

Get(key, hash)
Signature: (key:'TKey * hash:int64) -> 'TValue

Get the element with the supplied key. Throws an exception if the element is not found. This is an alias of the indexer.

Get(key, hash, defaultValue)
Signature: (key:'TKey * hash:int64 * defaultValue:'TValue) -> 'TValue

Get the element with the supplied key. Returns the supplied default value if the element is not found.

GetAndRemove(key)
Signature: key:'TKey -> 'TValue

Remove the item with the supplied key from the ConcurrentBigDict and return it. If multipe entries have the same key, the one that was inserted last is removed. If the item is not found, a KeyNotFoundException is thrown.

GetOrCreate(key, creator)
Signature: (key:'TKey * creator:Func<'TKey,'TValue>) -> 'TValue

Get the element with the supplied key. If the element is not found, the supplied creator is called to create a new element that is added to the ConcurrentBigDict and returned.

GetOrCreate(key, hash, creator)
Signature: (key:'TKey * hash:int64 * creator:Func<'TKey,'TValue>) -> 'TValue

Get the element with the supplied key. If the element is not found, the supplied creator is called to create a new element that is added to the ConcurrentBigDict and returned.

GetOrDefault(key)
Signature: key:'TKey -> 'TValue

Get the element with the supplied key. Returns the default value of the value type if the element is not found.

[()]
Signature: unit -> 'TKey

Get or set the item with the supplied key. If multiple items with the same key are allowed, the ConcurrentBigDict acts as a stack.

KeysToArray()
Signature: unit -> 'TKey []

Returns all keys in the dictionary as an array. This may throw a ConcurrentDataModifiedException if data is modified by another task during the operation.

LongCount
Signature: int64

Returns the number of items currently contained in the ConcurrentBigDict as long.

NonConcurrent
Signature: BigDict<'TKey,'TValue>

Return the non-concurrent contained ConcurrentBigDict.

Remove(key)
Signature: key:'TKey -> bool

Try to remove the item with the supplied key from the ConcurrentBigDict. and return true if it was succesfully removed. If multipe entries have the same key, the one that was inserted last is removed. If the item is not found, false is returned.

Remove(key, hash)
Signature: (key:'TKey * hash:int64) -> bool

Try to remove the item with the supplied key from the ConcurrentBigDict. and return true if it was succesfully removed. If multipe entries have the same key, the one that was inserted last is removed. If the item is not found, false is returned.

Remove(key, value)
Signature: (key:'TKey * value:'TValue) -> bool

Remove the item with the supplied key and the supplied value from the ConcurrentBigDict. Returns true if the value was removed.

Remove(key, hash, value)
Signature: (key:'TKey * hash:int64 * value:'TValue) -> bool

Remove the item with the supplied key and the supplied value from the ConcurrentBigDict. Returns true if the value was removed.

Remove(item)
Signature: item:KeyValuePair<'TKey,'TValue> -> bool

Remove the item with the supplied KeyValuePair from the ConcurrentBigDict. If the item is not found, a KeyNotFoundException is thrown.

ToArray()
Signature: unit -> KeyValuePair<'TKey,'TValue> []

Returns all KeyValuePairs in the dictionary as an array. This may throw a ConcurrentDataModifiedException if data is modified by another task during the operation.

TryAdd(key, value)
Signature: (key:'TKey * value:'TValue) -> bool

Add the item with the supplied key and the supplied value to the ConcurrentBigDict.

TryAdd(key, hash, value)
Signature: (key:'TKey * hash:int64 * value:'TValue) -> bool

Add the item with the supplied key and the supplied value to the ConcurrentBigDict.

TryGetValue(key, value)
Signature: (key:'TKey * value:byref<'TValue>) -> bool

Try to retrieve the value with the supplied key, return true if successful and return the value via the out parameter.

TryGetValue(key, hash, value)
Signature: (key:'TKey * hash:int64 * value:byref<'TValue>) -> bool

Try to retrieve the value with the supplied key, return true if successful and return the value via the out parameter.

TryRemove(key, value)
Signature: (key:'TKey * value:byref<'TValue>) -> bool

Try to reomve the item with the supplied key. If multipe entries have the same key, the one that was inserted last is removed. Returns true if the item was found, which is returned via the out parameter.

TryRemove(key, hash, value)
Signature: (key:'TKey * hash:int64 * value:byref<'TValue>) -> bool

Try to reomve the item with the supplied key. If multipe entries have the same key, the one that was inserted last is removed. Returns true if the item was found, which is returned via the out parameter.

TryRemove(key, value)
Signature: (key:'TKey * value:'TValue) -> bool

Try to reomve the item with the supplied key and the supplied value. If multipe entries match, the one that was inserted last is removed. Returns true if the item was found.

TryRemove(key, hash, value)
Signature: (key:'TKey * hash:int64 * value:'TValue) -> bool

Try to reomve the item with the supplied key and the supplied value. If multipe entries match, the one that was inserted last is removed. Returns true if the item was found.

ValuesToArray()
Signature: unit -> 'TValue []

Returns all values in the dictionary as an array. This may throw a ConcurrentDataModifiedException if data is modified by another task during the operation.

ValueWithKeySkip(key, skip)
Signature: (key:'TKey * skip:int64) -> 'TValue

Return the value with the given key, but skip a supplied number of entries with this key. This method is only useful if multiple item with the same key are allowed.

Fork me on GitHub