NativeKeyValueArrays<TKey, TValue>
The keys and values of a hash map copied into two parallel arrays.
Read time 1 minuteLast updated 13 days ago
Definition
- Type: Struct
- Namespace: Unity.Collections
- Assembly: UnityEngine.ManagedKernelModule
- Implements: INativeDisposable, IDisposable
public struct NativeKeyValueArrays<TKey, TValue> : INativeDisposable, IDisposable where TKey : unmanaged where TValue : unmanaged
Remarks
For each key-value pair copied from the hash map, the key is stored in while the value is stored in (for the same ).
Keys[i]Values[i]iNativeKeyValueArrays is not actually itself a native collection: it contains a NativeArray for the keys and a NativeArray for the values, but a NativeKeyValueArrays does not have its own safety handles.
Fields
Constructors
Constructor | Description |
|---|---|
| NativeKeyValueArrays`2(System.Int32,Unity.Collections.AllocatorManager.AllocatorHandle,Unity.Collections.NativeArrayOptions) | Initializes and returns an instance of NativeKeyValueArrays. |
Properties
Property | Description |
|---|---|
| Length | The number of key-value pairs. |
Methods
Method | Description |
|---|---|
| Dispose | Releases all resources (memory and safety handles). |