Struct NativeKeyValueArrays<TKey, TValue> | Collections | 0.11.0-preview.17
docs.unity3d.com
    Show / Hide Table of Contents

    Struct NativeKeyValueArrays<TKey, TValue>

    Key value arrays.

    Namespace: Unity.Collections
    Syntax
    public struct NativeKeyValueArrays<TKey, TValue> : IDisposable where TKey : struct where TValue : struct
    Type Parameters
    Name Description
    TKey

    The type of the keys in the container.

    TValue

    The type of the values in the container.

    Constructors

    NativeKeyValueArrays(Int32, Allocator, NativeArrayOptions)

    NativeKeyValueArrays constructor.

    Declaration
    public NativeKeyValueArrays(int length, Allocator allocator, NativeArrayOptions options)
    Parameters
    Type Name Description
    Int32 length

    The length of the arrays.

    Allocator allocator

    A member of the Unity.Collections.Allocator enumeration.

    NativeArrayOptions options

    Memory should be cleared on allocation or left uninitialized.

    Fields

    Keys

    Declaration
    public NativeArray<TKey> Keys
    Field Value
    Type Description
    NativeArray<TKey>

    Values

    Declaration
    public NativeArray<TValue> Values
    Field Value
    Type Description
    NativeArray<TValue>

    Properties

    Length

    The current number of items in the container.

    Declaration
    public int Length { get; }
    Property Value
    Type Description
    Int32

    The item count.

    Methods

    Dispose()

    Disposes of this container and deallocates its memory immediately.

    Declaration
    public void Dispose()

    Dispose(JobHandle)

    Safely disposes of this container and deallocates its memory when the jobs that use it have completed.

    Declaration
    public JobHandle Dispose(JobHandle inputDeps)
    Parameters
    Type Name Description
    JobHandle inputDeps

    The job handle or handles for any scheduled jobs that use this container.

    Returns
    Type Description
    JobHandle

    A new job handle containing the prior handles as well as the handle for the job that deletes the container.

    Remarks

    You can call this function dispose of the container immediately after scheduling the job. Pass the JobHandle returned by the Job.Schedule method using the jobHandle parameter so the job scheduler can dispose the container after all jobs using it have run.

    In This Article
    • Constructors
      • NativeKeyValueArrays(Int32, Allocator, NativeArrayOptions)
    • Fields
      • Keys
      • Values
    • Properties
      • Length
    • Methods
      • Dispose()
      • Dispose(JobHandle)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023