Class NativeSortExtension
Extension methods for sorting various containers.
Namespace: Unity.Collections
Syntax
public static class NativeSortExtension : object
Methods
BinarySearch<T>(T*, Int32, T)
Binary search for the value in the sorted container.
Declaration
public static int BinarySearch<T>(T*ptr, int length, T value)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
T* | ptr | Array to perform sort. |
Int32 | length | Number of elements to perform binary search. |
T | value | The value to search in sorted array. |
Returns
Type | Description |
---|---|
Int32 | Positive index of the specified value if value is found. Otherwise bitwise complement of index of first greater value. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
Remarks
Array must be sorted, otherwise value searched might not be found even when it is in array. IComparer corresponds to IComparer used by sort.
BinarySearch<T>(NativeArray<T>, T)
Binary search for the value in the sorted container.
Declaration
public static int BinarySearch<T>(this NativeArray<T> container, T value)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
NativeArray<T> | container | The container to perform search. |
T | value | The value to search for. |
Returns
Type | Description |
---|---|
Int32 | Positive index of the specified value if value is found. Otherwise bitwise complement of index of first greater value. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
Remarks
Array must be sorted, otherwise value searched might not be found even when it is in array. IComparer corresponds to IComparer used by sort.
BinarySearch<T>(NativeSlice<T>, T)
Binary search for the value in the sorted container.
Declaration
public static int BinarySearch<T>(this NativeSlice<T> container, T value)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
NativeSlice<T> | container | The container to perform search. |
T | value | The value to search for. |
Returns
Type | Description |
---|---|
Int32 | Positive index of the specified value if value is found. Otherwise bitwise complement of index of first greater value. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
Remarks
Array must be sorted, otherwise value searched might not be found even when it is in array. IComparer corresponds to IComparer used by sort.
BinarySearch<T>(UnsafeList, T)
Binary search for the value in the sorted container.
Declaration
public static int BinarySearch<T>(this UnsafeList container, T value)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeList | container | The container to perform search. |
T | value | The value to search for. |
Returns
Type | Description |
---|---|
Int32 | Positive index of the specified value if value is found. Otherwise bitwise complement of index of first greater value. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
Remarks
Array must be sorted, otherwise value searched might not be found even when it is in array. IComparer corresponds to IComparer used by sort.
BinarySearch<T>(UnsafeList<T>, T)
Binary search for the value in the sorted container.
Declaration
public static int BinarySearch<T>(this UnsafeList<T> container, T value)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeList<T> | container | The container to perform search. |
T | value | The value to search for. |
Returns
Type | Description |
---|---|
Int32 | Positive index of the specified value if value is found. Otherwise bitwise complement of index of first greater value. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
Remarks
Array must be sorted, otherwise value searched might not be found even when it is in array. IComparer corresponds to IComparer used by sort.
BinarySearch<T>(NativeList<T>, T)
Binary search for the value in the sorted container.
Declaration
public static int BinarySearch<T>(this NativeList<T> container, T value)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
NativeList<T> | container | The container to perform search. |
T | value | The value to search for. |
Returns
Type | Description |
---|---|
Int32 | Positive index of the specified value if value is found. Otherwise bitwise complement of index of first greater value. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
Remarks
Array must be sorted, otherwise value searched might not be found even when it is in array. IComparer corresponds to IComparer used by sort.
BinarySearch<T, U>(T*, Int32, T, U)
Binary search for the value in the sorted array.
Declaration
public static int BinarySearch<T, U>(T*ptr, int length, T value, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
T* | ptr | Array to perform binary search. |
Int32 | length | Number of elements to perform binary search. |
T | value | The value to search in sorted array. |
U | comp | A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element. |
Returns
Type | Description |
---|---|
Int32 | Positive index of the specified value if value is found. Otherwise bitwise complement of index of first greater value. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
U | The comparer type. |
Remarks
Array must be sorted, otherwise value searched might not be found even when it is in array. IComparer corresponds to IComparer used by sort.
BinarySearch<T, U>(NativeArray<T>, T, U)
Binary search for the value in the sorted container.
Declaration
public static int BinarySearch<T, U>(this NativeArray<T> container, T value, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
NativeArray<T> | container | The container to perform search. |
T | value | The value to search for. |
U | comp | A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element. |
Returns
Type | Description |
---|---|
Int32 | Positive index of the specified value if value is found. Otherwise bitwise complement of index of first greater value. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
U | The comparer type. |
Remarks
Array must be sorted, otherwise value searched might not be found even when it is in array. IComparer corresponds to IComparer used by sort.
BinarySearch<T, U>(NativeSlice<T>, T, U)
Binary search for the value in the sorted container.
Declaration
public static int BinarySearch<T, U>(this NativeSlice<T> container, T value, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
NativeSlice<T> | container | The container to perform search. |
T | value | The value to search for. |
U | comp | A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element. |
Returns
Type | Description |
---|---|
Int32 | Positive index of the specified value if value is found. Otherwise bitwise complement of index of first greater value. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
U | The comparer type. |
Remarks
Array must be sorted, otherwise value searched might not be found even when it is in array. IComparer corresponds to IComparer used by sort.
BinarySearch<T, U>(UnsafeList, T, U)
Binary search for the value in the sorted container.
Declaration
public static int BinarySearch<T, U>(this UnsafeList container, T value, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeList | container | The container to perform search. |
T | value | The value to search for. |
U | comp | A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element. |
Returns
Type | Description |
---|---|
Int32 | Positive index of the specified value if value is found. Otherwise bitwise complement of index of first greater value. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
U | The comparer type. |
Remarks
Array must be sorted, otherwise value searched might not be found even when it is in array. IComparer corresponds to IComparer used by sort.
BinarySearch<T, U>(UnsafeList<T>, T, U)
Binary search for the value in the sorted container.
Declaration
public static int BinarySearch<T, U>(this UnsafeList<T> container, T value, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeList<T> | container | The container to perform search. |
T | value | The value to search for. |
U | comp | A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element. |
Returns
Type | Description |
---|---|
Int32 | Positive index of the specified value if value is found. Otherwise bitwise complement of index of first greater value. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
U | The comparer type. |
Remarks
Array must be sorted, otherwise value searched might not be found even when it is in array. IComparer corresponds to IComparer used by sort.
BinarySearch<T, U>(NativeList<T>, T, U)
Binary search for the value in the sorted container.
Declaration
public static int BinarySearch<T, U>(this NativeList<T> container, T value, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
NativeList<T> | container | The container to perform search. |
T | value | The value to search for. |
U | comp | A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element. |
Returns
Type | Description |
---|---|
Int32 | Positive index of the specified value if value is found. Otherwise bitwise complement of index of first greater value. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
U | The comparer type. |
Remarks
Array must be sorted, otherwise value searched might not be found even when it is in array. IComparer corresponds to IComparer used by sort.
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>(T*, Int32, JobHandle)
Sorts an array in ascending order.
Declaration
public static JobHandle Sort<T>(T*array, int length, JobHandle inputDeps)
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 |
Sort<T>(NativeArray<T>)
Sorts an array in ascending order.
Declaration
public static void Sort<T>(this NativeArray<T> container)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
NativeArray<T> | container | Array to perform sort. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
Sort<T>(NativeArray<T>, JobHandle)
Sorts an array in ascending order.
Declaration
public static JobHandle Sort<T>(this NativeArray<T> container, JobHandle inputDeps)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
NativeArray<T> | container | 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 |
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>(NativeSlice<T>, JobHandle)
Sorts the container in ascending order.
Declaration
public static JobHandle Sort<T>(this NativeSlice<T> container, JobHandle inputDeps)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
NativeSlice<T> | container | The container 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 |
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>(UnsafeList, JobHandle)
Sorts the container in ascending order.
Declaration
public static JobHandle Sort<T>(this UnsafeList container, JobHandle inputDeps)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeList | container | The container 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 |
Sort<T>(UnsafeList<T>)
Sorts a list in ascending order.
Declaration
public static void Sort<T>(this UnsafeList<T> list)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeList<T> | list | List to perform sort. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
Sort<T>(UnsafeList<T>, JobHandle)
Sorts the container in ascending order.
Declaration
public static JobHandle Sort<T>(this UnsafeList<T> container, JobHandle inputDeps)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeList<T> | container | The container 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 |
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>(NativeList<T>, JobHandle)
Sorts the container in ascending order.
Declaration
public static JobHandle Sort<T>(this NativeList<T> container, JobHandle inputDeps)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
NativeList<T> | container | The container 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 |
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 | The comparer type. |
Sort<T, U>(T*, Int32, U, JobHandle)
Sorts an array using a custom comparison function.
Declaration
public static JobHandle Sort<T, U>(T*array, int length, U comp, JobHandle inputDeps)
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. |
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 |
U | The comparer type. |
Sort<T, U>(NativeArray<T>, U)
Sorts an array using a custom comparison function.
Declaration
public static void Sort<T, U>(this NativeArray<T> container, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
NativeArray<T> | container | 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 | The comparer type. |
Sort<T, U>(NativeArray<T>, U, JobHandle)
Sorts an array using a custom comparison function.
Declaration
public static JobHandle Sort<T, U>(this NativeArray<T> container, U comp, JobHandle inputDeps)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
NativeArray<T> | container | 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. |
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 |
U | The comparer type. |
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 | The comparer type. |
Sort<T, U>(NativeSlice<T>, U, JobHandle)
Sorts the container using a custom comparison function.
Declaration
public static JobHandle Sort<T, U>(this NativeSlice<T> container, U comp, JobHandle inputDeps)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
NativeSlice<T> | container | The container 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. |
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 |
U | The comparer type. |
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 | The comparer type. |
Sort<T, U>(UnsafeList, U, JobHandle)
Sorts the container using a custom comparison function.
Declaration
public static JobHandle Sort<T, U>(this UnsafeList container, U comp, JobHandle inputDeps)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeList | container | The container 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. |
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 |
U | The comparer type. |
Sort<T, U>(UnsafeList<T>, U)
Sorts a list using a custom comparison function.
Declaration
public static void Sort<T, U>(this UnsafeList<T> list, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeList<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 | The comparer type. |
Sort<T, U>(UnsafeList<T>, U, JobHandle)
Sorts the container using a custom comparison function.
Declaration
public static JobHandle Sort<T, U>(this UnsafeList<T> container, U comp, JobHandle inputDeps)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeList<T> | container | The container 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. |
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 |
U | The comparer type. |
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 | The comparer type. |
Sort<T, U>(NativeList<T>, U, JobHandle)
Sorts the container using a custom comparison function.
Declaration
public static JobHandle Sort<T, U>(this NativeList<T> list, U comp, JobHandle inputDeps)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
NativeList<T> | list | The container 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. |
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 |
U | The comparer type. |
SortJob<T>(T*, Int32)
Creates a job that will sort an array in ascending order.
Declaration
public static SortJob<T, NativeSortExtension.DefaultComparer<T>> SortJob<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. |
Returns
Type | Description |
---|---|
SortJob<T, NativeSortExtension.DefaultComparer<T>> | The job that will sort the container. Scheduling the job is left to the user. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
SortJob<T>(NativeArray<T>)
Creates a job that will sort an array in ascending order.
Declaration
public static SortJob<T, NativeSortExtension.DefaultComparer<T>> SortJob<T>(this NativeArray<T> container)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
NativeArray<T> | container | Array to sort. |
Returns
Type | Description |
---|---|
SortJob<T, NativeSortExtension.DefaultComparer<T>> | The job that will sort the container. Scheduling the job is left to the user. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
SortJob<T>(NativeSlice<T>)
Creates a job that will sort a slice in ascending order.
Declaration
public static SortJob<T, NativeSortExtension.DefaultComparer<T>> SortJob<T>(this NativeSlice<T> slice)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
NativeSlice<T> | slice | Slice to sort. |
Returns
Type | Description |
---|---|
SortJob<T, NativeSortExtension.DefaultComparer<T>> | The job that will sort the slice. Scheduling the job is left to the user. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
SortJob<T>(UnsafeList)
Creates a job that will sort a list in ascending order.
Declaration
public static SortJob<T, NativeSortExtension.DefaultComparer<T>> SortJob<T>(this UnsafeList list)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeList | list | List to sort. |
Returns
Type | Description |
---|---|
SortJob<T, NativeSortExtension.DefaultComparer<T>> | The job that will sort the list. Scheduling the job is left to the user. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
SortJob<T>(UnsafeList<T>)
Creates a job that will sort a list using a comparison function.
Declaration
public static SortJob<T, NativeSortExtension.DefaultComparer<T>> SortJob<T>(this UnsafeList<T> list)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeList<T> | list | List to sort. |
Returns
Type | Description |
---|---|
SortJob<T, NativeSortExtension.DefaultComparer<T>> | The job that will sort the list. Scheduling the job is left to the user. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
SortJob<T>(NativeList<T>)
Creates a job that will sort an array in ascending order.
Declaration
public static SortJob<T, NativeSortExtension.DefaultComparer<T>> SortJob<T>(this NativeList<T> list)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
NativeList<T> | list | List to sort. |
Returns
Type | Description |
---|---|
SortJob<T, NativeSortExtension.DefaultComparer<T>> | The job that will sort the container. Scheduling the job is left to the user. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
SortJob<T, U>(T*, Int32, U)
Creates a job that will sort an array using a comparison function.
Declaration
public static SortJob<T, U> SortJob<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. |
Returns
Type | Description |
---|---|
SortJob<T, U> | The job that will sort the container. Scheduling the job is left to the user. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
U | The comparer type. |
SortJob<T, U>(NativeArray<T>, U)
Creates a job that will sort an array using a comparison function.
Declaration
public static SortJob<T, U> SortJob<T, U>(this NativeArray<T> container, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
NativeArray<T> | container | 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. |
Returns
Type | Description |
---|---|
SortJob<T, U> | The job that will sort the container. Scheduling the job is left to the user. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
U | The comparer type. |
SortJob<T, U>(NativeSlice<T>, U)
Creates a job that will sort a slice using a comparison function.
Declaration
public static SortJob<T, U> SortJob<T, U>(this NativeSlice<T> slice, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
NativeSlice<T> | slice | Slice to sort. |
U | comp | A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element. |
Returns
Type | Description |
---|---|
SortJob<T, U> | The job that will sort the slice. Scheduling the job is left to the user. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
U | The comparer type. |
SortJob<T, U>(UnsafeList, U)
Creates a job that will sort a list using a comparison function.
Declaration
public static SortJob<T, U> SortJob<T, U>(this UnsafeList list, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeList | list | List to sort. |
U | comp | A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element. |
Returns
Type | Description |
---|---|
SortJob<T, U> | The job that will sort the list. Scheduling the job is left to the user. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
U | The comparer type. |
SortJob<T, U>(UnsafeList<T>, U)
Creates a job that will sort a list using a comparison function.
Declaration
public static SortJob<T, U> SortJob<T, U>(this UnsafeList<T> list, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeList<T> | list | List to sort. |
U | comp | A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element. |
Returns
Type | Description |
---|---|
SortJob<T, U> | The job that will sort the list. Scheduling the job is left to the user. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
U | The comparer type. |
SortJob<T, U>(NativeList<T>, U)
Creates a job that will sort a list using a comparison function.
Declaration
public static SortJob<T, U> SortJob<T, U>(this NativeList<T> container, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
NativeList<T> | container | List to sort. |
U | comp | A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element. |
Returns
Type | Description |
---|---|
SortJob<T, U> | The job that will sort the container. Scheduling the job is left to the user. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
U | The comparer type. |