Class CoreUnsafeUtils
Inheritance
CoreUnsafeUtils
Syntax
public static class CoreUnsafeUtils
Methods
CombineHashes(Int32, Hash128*, Hash128*)
Declaration
public static void CombineHashes(int count, Hash128*hashes, Hash128*outHash)
Parameters
Type |
Name |
Description |
Int32 |
count |
|
Hash128* |
hashes |
|
Hash128* |
outHash |
|
CombineHashes<TValue, TGetter>(Int32, Void*, Hash128*)
Combine all of the hashes of a collection of hashes.
Declaration
public static void CombineHashes<TValue, TGetter>(int count, void *hashes, Hash128*outHash)
where TValue : struct where TGetter : struct, CoreUnsafeUtils.IKeyGetter<TValue, Hash128>
Parameters
Type |
Name |
Description |
Int32 |
count |
Number of hash to combine.
|
Void* |
hashes |
Hashes to combine.
|
Hash128* |
outHash |
Hash to update.
|
Type Parameters
Name |
Description |
TValue |
|
TGetter |
|
CompareHashes(Int32, Hash128*, Int32, Hash128*, Int32*, Int32*, out Int32, out Int32)
Declaration
public static int CompareHashes(int oldHashCount, Hash128*oldHashes, int newHashCount, Hash128*newHashes, int *addIndices, int *removeIndices, out int addCount, out int remCount)
Parameters
Type |
Name |
Description |
Int32 |
oldHashCount |
|
Hash128* |
oldHashes |
|
Int32 |
newHashCount |
|
Hash128* |
newHashes |
|
Int32* |
addIndices |
|
Int32* |
removeIndices |
|
Int32 |
addCount |
|
Int32 |
remCount |
|
Returns
CompareHashes<TOldValue, TOldGetter, TNewValue, TNewGetter>(Int32, Void*, Int32, Void*, Int32*, Int32*, out Int32, out Int32)
Compare hashes of two collections and provide
a list of indices removeIndices
to remove in oldHashes
and a list of indices addIndices
to add in newHashes
.
Assumes that newHashes
and oldHashes
are sorted.
Declaration
public static int CompareHashes<TOldValue, TOldGetter, TNewValue, TNewGetter>(int oldHashCount, void *oldHashes, int newHashCount, void *newHashes, int *addIndices, int *removeIndices, out int addCount, out int remCount)
where TOldValue : struct where TOldGetter : struct, CoreUnsafeUtils.IKeyGetter<TOldValue, Hash128> where TNewValue : struct where TNewGetter : struct, CoreUnsafeUtils.IKeyGetter<TNewValue, Hash128>
Parameters
Type |
Name |
Description |
Int32 |
oldHashCount |
Number of hashes in oldHashes .
|
Void* |
oldHashes |
Previous hashes to compare.
|
Int32 |
newHashCount |
Number of hashes in newHashes .
|
Void* |
newHashes |
New hashes to compare.
|
Int32* |
addIndices |
Indices of element to add in newHashes will be written here.
|
Int32* |
removeIndices |
Indices of element to remove in oldHashes will be written here.
|
Int32 |
addCount |
Number of elements to add will be written here.
|
Int32 |
remCount |
Number of elements to remove will be written here.
|
Returns
Type |
Description |
Int32 |
The number of operation to perform ( addCount + remCount
)
|
Type Parameters
Name |
Description |
TOldValue |
|
TOldGetter |
|
TNewValue |
|
TNewGetter |
|
CopyTo<T>(T[], Void*, Int32)
Declaration
public static void CopyTo<T>(this T[] list, void *dest, int count)
where T : struct
Parameters
Type |
Name |
Description |
T[] |
list |
|
Void* |
dest |
|
Int32 |
count |
|
Type Parameters
CopyTo<T>(List<T>, Void*, Int32)
Declaration
public static void CopyTo<T>(this List<T> list, void *dest, int count)
where T : struct
Parameters
Type Parameters
HaveDuplicates(Int32[])
Declaration
public static bool HaveDuplicates(int[] arr)
Parameters
Type |
Name |
Description |
Int32[] |
arr |
|
Returns
IndexOf<T>(Void*, Int32, T)
Declaration
public static int IndexOf<T>(void *data, int count, T v)
where T : struct, IEquatable<T>
Parameters
Type |
Name |
Description |
Void* |
data |
|
Int32 |
count |
|
T |
v |
|
Returns
Type Parameters
QuickSort(UInt32[], Int32, Int32)
Declaration
public static void QuickSort(uint[] arr, int left, int right)
Parameters
QuickSort<T>(Int32, Void*)
Declaration
public static void QuickSort<T>(int count, void *data)
where T : struct, IComparable<T>
Parameters
Type Parameters
QuickSort<TValue, TKey, TGetter>(Int32, Void*)
Declaration
public static void QuickSort<TValue, TKey, TGetter>(int count, void *data)
where TValue : struct where TKey : struct, IComparable<TKey> where TGetter : struct, CoreUnsafeUtils.IKeyGetter<TValue, TKey>
Parameters
Type Parameters
Name |
Description |
TValue |
|
TKey |
|
TGetter |
|
QuickSort<TValue, TKey, TGetter>(Void*, Int32, Int32)
Declaration
public static void QuickSort<TValue, TKey, TGetter>(void *data, int left, int right)
where TValue : struct where TKey : struct, IComparable<TKey> where TGetter : struct, CoreUnsafeUtils.IKeyGetter<TValue, TKey>
Parameters
Type Parameters
Name |
Description |
TValue |
|
TKey |
|
TGetter |
|