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

    Struct UnsafeHashMap<TKey, TValue>.ParallelWriter

    Implements parallel writer. Use AsParallelWriter to obtain it from container.

    Namespace: Unity.Collections.LowLevel.Unsafe
    Syntax
    [NativeContainerIsAtomicWriteOnly]
    public struct ParallelWriter

    Properties

    Capacity

    The number of items that can fit in the container.

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

    The number of items that the container can hold before it resizes its internal storage.

    Remarks

    Capacity specifies the number of items the container can currently hold. You can change Capacity to fit more or fewer items. Changing Capacity creates a new array of the specified size, copies the old array to the new one, and then deallocates the original array memory.

    Methods

    TryAdd(TKey, TValue)

    Try adding an element with the specified key and value into the container. If the key already exist, the value won't be updated.

    Declaration
    public bool TryAdd(TKey key, TValue item)
    Parameters
    Type Name Description
    TKey key

    The key of the element to add.

    TValue item

    The value of the element to add.

    Returns
    Type Description
    Boolean

    Returns true if value is added into the container, otherwise returns false.

    In This Article
    • Properties
      • Capacity
    • Methods
      • TryAdd(TKey, TValue)
    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