Class NativeSortExtension | Collections | 0.6.0-preview.9
docs.unity3d.com
    Show / Hide Table of Contents

    Class NativeSortExtension

    Inheritance
    Object
    NativeSortExtension
    Namespace: Unity.Collections
    Syntax
    public static class NativeSortExtension

    Methods

    Sort<T>(T*, Int32)

    Sorts an array in ascending order.

    Declaration
    public static void Sort<T>(T*array, int length)
        where T : struct, IComparable<T>
    Parameters
    Type Name Description
    T* array

    Array to perform sort.

    Int32 length

    Number of elements to perform sort.

    Type Parameters
    Name Description
    T

    Source type of elements

    Sort<T>(NativeArray<T>)

    Sorts an array in ascending order.

    Declaration
    public static void Sort<T>(this NativeArray<T> array)
        where T : struct, IComparable<T>
    Parameters
    Type Name Description
    NativeArray<T> array

    Array to perform sort.

    Type Parameters
    Name Description
    T

    Source type of elements

    Sort<T>(NativeSlice<T>)

    Sorts a slice in ascending order.

    Declaration
    public static void Sort<T>(this NativeSlice<T> slice)
        where T : struct, IComparable<T>
    Parameters
    Type Name Description
    NativeSlice<T> slice

    Slice to perform sort.

    Type Parameters
    Name Description
    T

    Source type of elements

    Sort<T>(UnsafeList)

    Sorts a list in ascending order.

    Declaration
    public static void Sort<T>(this UnsafeList list)
        where T : struct, IComparable<T>
    Parameters
    Type Name Description
    UnsafeList list

    List to perform sort.

    Type Parameters
    Name Description
    T

    Source type of elements

    Sort<T>(NativeList<T>)

    Sorts a list in ascending order.

    Declaration
    public static void Sort<T>(this NativeList<T> list)
        where T : struct, IComparable<T>
    Parameters
    Type Name Description
    NativeList<T> list

    List to perform sort.

    Type Parameters
    Name Description
    T

    Source type of elements

    Sort<T, U>(T*, Int32, U)

    Sorts an array using a custom comparison function.

    Declaration
    public static void Sort<T, U>(T*array, int length, U comp)
        where T : struct where U : IComparer<T>
    Parameters
    Type Name Description
    T* array

    Array to perform sort.

    Int32 length

    Number of elements to perform sort.

    U comp

    A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element.

    Type Parameters
    Name Description
    T

    Source type of elements

    U

    Sort<T, U>(NativeArray<T>, U)

    Sorts an array using a custom comparison function.

    Declaration
    public static void Sort<T, U>(this NativeArray<T> array, U comp)
        where T : struct where U : IComparer<T>
    Parameters
    Type Name Description
    NativeArray<T> array

    Array to perform sort.

    U comp

    A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element.

    Type Parameters
    Name Description
    T

    Source type of elements

    U

    Sort<T, U>(NativeSlice<T>, U)

    Sorts a slice using a custom comparison function.

    Declaration
    public static void Sort<T, U>(this NativeSlice<T> slice, U comp)
        where T : struct where U : IComparer<T>
    Parameters
    Type Name Description
    NativeSlice<T> slice

    List to perform sort.

    U comp

    A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element.

    Type Parameters
    Name Description
    T

    Source type of elements

    U

    Sort<T, U>(UnsafeList, U)

    Sorts a list using a custom comparison function.

    Declaration
    public static void Sort<T, U>(this UnsafeList list, U comp)
        where T : struct where U : IComparer<T>
    Parameters
    Type Name Description
    UnsafeList list

    List to perform sort.

    U comp

    A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element.

    Type Parameters
    Name Description
    T

    Source type of elements

    U

    Sort<T, U>(NativeList<T>, U)

    Sorts a list using a custom comparison function.

    Declaration
    public static void Sort<T, U>(this NativeList<T> list, U comp)
        where T : struct where U : IComparer<T>
    Parameters
    Type Name Description
    NativeList<T> list

    List to perform sort.

    U comp

    A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element.

    Type Parameters
    Name Description
    T

    Source type of elements

    U

    SortJob<T>(T*, Int32, JobHandle)

    Sorts an array in ascending order.

    Declaration
    public static JobHandle SortJob<T>(T*array, int length, JobHandle inputDeps = null)
        where T : struct, IComparable<T>
    Parameters
    Type Name Description
    T* array

    Array to perform sort.

    Int32 length

    Number of elements to perform sort.

    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 sorts the container.

    Type Parameters
    Name Description
    T

    Source type of elements

    SortJob<T>(NativeArray<T>, JobHandle)

    Sorts an array in ascending order.

    Declaration
    public static JobHandle SortJob<T>(this NativeArray<T> array, JobHandle inputDeps = null)
        where T : struct, IComparable<T>
    Parameters
    Type Name Description
    NativeArray<T> array

    Array to perform sort.

    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 sorts the container.

    Type Parameters
    Name Description
    T

    Source type of elements

    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