Struct NativeMultiQueue<T> | Unity Transport | 0.3.1-preview.4
docs.unity3d.com
    Show / Hide Table of Contents

    Struct NativeMultiQueue<T>

    A NativeMultiQueue is a set of several FIFO queues split into buckets. Each bucket has its own first and last item and each bucket can have items pushed and popped individually.

    Namespace: Unity.Networking.Transport.Utilities
    Syntax
    public struct NativeMultiQueue<T> : IDisposable where T : struct
    Type Parameters
    Name Description
    T

    Constructors

    NativeMultiQueue(Int32)

    New NativeMultiQueue has a single bucket and the specified number of items for that bucket. Accessing buckets out of range will grow the number of buckets and pushing more items than the initial capacity will increase the number of items for each bucket.

    Declaration
    public NativeMultiQueue(int initialMessageCapacity)
    Parameters
    Type Name Description
    Int32 initialMessageCapacity

    Properties

    IsCreated

    Declaration
    public bool IsCreated { get; }
    Property Value
    Type Description
    Boolean

    Methods

    Clear(Int32)

    Remove all items from a specific bucket. If the bucket does not exist the call will not do anything.

    Declaration
    public void Clear(int bucket)
    Parameters
    Type Name Description
    Int32 bucket

    Dequeue(Int32, out T)

    Dequeue an item from a specific bucket. If the bucket does not exist or if the bucket is empty the call will fail and return false.

    Declaration
    public bool Dequeue(int bucket, out T value)
    Parameters
    Type Name Description
    Int32 bucket
    T value
    Returns
    Type Description
    Boolean

    Dispose()

    Declaration
    public void Dispose()

    Enqueue(Int32, T)

    Enqueue a new item to a specific bucket. If the bucket does not yet exist the number of buckets will be increased and if the queue is full the number of items for each bucket will be increased.

    Declaration
    public void Enqueue(int bucket, T value)
    Parameters
    Type Name Description
    Int32 bucket
    T value

    Peek(Int32, out T)

    Peek the next item in a specific bucket. If the bucket does not exist or if the bucket is empty the call will fail and return false.

    Declaration
    public bool Peek(int bucket, out T value)
    Parameters
    Type Name Description
    Int32 bucket
    T value
    Returns
    Type Description
    Boolean
    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