Search Results for

    Show / Hide Table of Contents

    Struct NativeSimpleQueue<T>

    A Unity.Collections.NativeArray<T> backed simplified first-in, first-out (FIFO) data structure.

    Implements
    System.IDisposable
    Namespace: GDX.Collections.Generic
    Syntax
    public struct NativeSimpleQueue<T> : IDisposable where T : struct
    Type Parameters
    Name Description
    T

    The type of System.Objects contained within.

    Remarks

    The NativeSimpleQueue<T> is backed by a Unity.Collections.NativeArray<T> which requires UnityEngine.CoreModule.dll.

    Constructors

    | Improve this Doc View Source

    NativeSimpleQueue(Int32, Allocator, NativeArrayOptions)

    Create a new NativeSimpleQueue<T>.

    Declaration
    public NativeSimpleQueue(int capacity, Allocator allocator, NativeArrayOptions nativeArrayOptions)
    Parameters
    Type Name Description
    System.Int32 capacity

    The maximum number of items allowed in the NativeSimpleQueue<T>

    Unity.Collections.Allocator allocator

    The Unity.Collections.Allocator type to use.

    Unity.Collections.NativeArrayOptions nativeArrayOptions

    Should the memory be cleared on allocation?

    Fields

    | Improve this Doc View Source

    Array

    Internal Unity.Collections.NativeArray<T> of backed data for the NativeSimpleQueue<T>.

    Declaration
    public NativeArray<T> Array
    Field Value
    Type Description
    Unity.Collections.NativeArray<T>
    | Improve this Doc View Source

    Count

    Number of elements.

    Declaration
    public int Count
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    EndIndex

    Last valid element (tail) index in the queue.

    Declaration
    public int EndIndex
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    FirstIndex

    First valid element (head) index in the queue.

    Declaration
    public int FirstIndex
    Field Value
    Type Description
    System.Int32

    Methods

    | Improve this Doc View Source

    Clear()

    Clear the NativeSimpleQueue<T>.

    Declaration
    public void Clear()
    | Improve this Doc View Source

    Dequeue()

    Pop (remove and return) the first element from the NativeSimpleQueue<T>.

    Declaration
    public T Dequeue()
    Returns
    Type Description
    T

    The first element.

    | Improve this Doc View Source

    Dispose()

    Properly dispose of the NativeSimpleQueue<T>.

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    Enqueue(T, Allocator, NativeArrayOptions)

    Add an item to the NativeSimpleQueue<T> at its end..

    Declaration
    public void Enqueue(T item, Allocator allocator, NativeArrayOptions nativeArrayOptions)
    Parameters
    Type Name Description
    T item

    The typed System.Object to add.

    Unity.Collections.Allocator allocator

    The Unity.Collections.Allocator type to use.

    Unity.Collections.NativeArrayOptions nativeArrayOptions

    Should the memory be cleared on allocation?

    | Improve this Doc View Source

    GetElementAt(Int32)

    Retrieve the element at the provided index.

    Declaration
    public T GetElementAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The target System.Object index.

    Returns
    Type Description
    T

    The target element.

    | Improve this Doc View Source

    Peek()

    Retrieve the first element from the NativeSimpleQueue<T>.

    Declaration
    public T Peek()
    Returns
    Type Description
    T

    The first element.

    | Improve this Doc View Source

    TrimExcess(Allocator, NativeArrayOptions)

    Shrink the capacity of the NativeSimpleQueue<T> to fit its contents.

    Declaration
    public void TrimExcess(Allocator allocator, NativeArrayOptions nativeArrayOptions)
    Parameters
    Type Name Description
    Unity.Collections.Allocator allocator

    The Unity.Collections.Allocator type to use.

    Unity.Collections.NativeArrayOptions nativeArrayOptions

    Should the memory be cleared on allocation?

    Implements

    System.IDisposable
    • Improve this Doc
    • View Source
    In This Article
    Back to top Built on 2021-04-06 against v1.3.0.
    Generated by DocFX