Struct NativeParallelMultiHashMap<TKey, TValue>
An unordered, expandable associative array. Each key can have more than one associated value.
Implements
Namespace: Unity.Collections
Assembly: solution.dll
Syntax
[NativeContainer]
public struct NativeParallelMultiHashMap<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 NativeParallelHashMap, a NativeParallelMultiHashMap 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 |
---|---|
NativeParallelMultiHashMap(int, AllocatorHandle) | Returns a newly allocated multi hash map. |
Properties
Name | Description |
---|---|
Capacity | Returns the number of key-value pairs that fit in the current allocation. |
IsCreated | Whether this hash map has been allocated (and not yet deallocated). |
IsEmpty | Whether this hash map is empty. |
Methods
Name | Description |
---|---|
Add(TKey, TValue) | Adds a new key-value pair. |
AsParallelWriter() | Returns a parallel writer for this hash map. |
AsReadOnly() | Returns a readonly version of this NativeParallelHashMap instance. |
Clear() | Removes all key-value pairs. |
ContainsKey(TKey) | 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. |
CountValuesForKey(TKey) | Returns the number of values associated with a given key. |
Dispose() | Releases all resources (memory and safety handles). |
Dispose(JobHandle) | Creates and schedules a job that will dispose this hash map. |
GetEnumerator() | Returns an enumerator over the key-value pairs of this hash map. |
GetKeyArray(AllocatorHandle) | Returns an array with a copy of all the keys (in no particular order). |
GetKeyValueArrays(AllocatorHandle) | Returns a NativeKeyValueArrays with a copy of all the keys and values (in no particular order). |
GetValueArray(AllocatorHandle) | Returns an array with a copy of all the values (in no particular order). |
GetValuesForKey(TKey) | Returns an enumerator over the values of an individual key. |
Remove(NativeParallelMultiHashMapIterator<TKey>) | Removes a single key-value pair. |
Remove(TKey) | Removes a key and its associated value(s). |
SetValue(TValue, NativeParallelMultiHashMapIterator<TKey>) | Sets a new value for an existing key-value pair. |
TryGetFirstValue(TKey, out TValue, out NativeParallelMultiHashMapIterator<TKey>) | Gets an iterator for a key. |
TryGetNextValue(out TValue, ref NativeParallelMultiHashMapIterator<TKey>) | Advances an iterator to the next value associated with its key. |