Struct UnsafeParallelMultiHashMap<TKey, TValue>
An unordered, expandable associative array. Each key can have more than one associated value.
Implements
Namespace: Unity.Collections.LowLevel .Unsafe
Assembly: solution.dll
Syntax
public struct UnsafeParallelMultiHashMap<TKey, TValue> : INativeDisposable where TKey : unmanaged, IEquatable<TKey> where TValue : unmanaged
Type Parameters
Name | Description |
---|---|
TKey | The type of the keys. |
TValue | The type of the values. |
Remarks
Unlike a regular UnsafeParallelHashMap, an UnsafeParallelMultiHashMap can store multiple key-value pairs with the same key.
The keys are not deduplicated: two key-value pairs with the same key are stored as fully separate key-value pairs.
Constructors
Name | Description |
---|---|
Unsafe |
Initializes and returns an instance of UnsafeParallelMultiHashMap. |
Properties
Name | Description |
---|---|
Capacity | Returns the number of key-value pairs that fit in the current allocation. |
Is |
Whether this hash map has been allocated (and not yet deallocated). |
Is |
Whether this hash map is empty. |
Methods
Name | Description |
---|---|
Add(TKey, TValue) | Adds a new key-value pair. |
As |
Returns a parallel writer for this hash map. |
As |
Returns a readonly version of this NativeParallelHashMap instance. |
Clear() | Removes all key-value pairs. |
Contains |
Returns true if a given key is present in this hash map. |
Count() | Returns the current number of key-value pairs in this hash map. |
Count |
Returns the number of values associated with a given key. |
Dispose() | Releases all resources (memory and safety handles). |
Dispose(Job |
Creates and schedules a job that will dispose this hash map. |
Get |
Returns an enumerator over the key-value pairs of this hash map. |
Get |
Returns an array with a copy of all the keys (in no particular order). |
Get |
Returns a NativeKeyValueArrays with a copy of all the keys and values (in no particular order). |
Get |
Returns an array with a copy of all the values (in no particular order). |
Get |
Returns an enumerator over the values of an individual key. |
Remove(Native |
Removes a single key-value pair. |
Remove(TKey) | Removes a key and its associated value(s). |
Remove<TValue |
Removes all key-value pairs with a particular key and a particular value. |
Set |
Sets a new value for an existing key-value pair. |
Try |
Gets an iterator for a key. |
Try |
Advances an iterator to the next value associated with its key. |