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 |
|---|---|
| UnsafeParallelMultiHashMap(int, AllocatorHandle) | Initializes and returns an instance of UnsafeParallelMultiHashMap. |
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). |
| Remove<TValueEQ>(TKey, TValueEQ) | Removes all key-value pairs with a particular key and a particular value. |
| 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. |