Class UnsafeHelper
- Namespace
- HelixToolkit.SharpDX.Utilities
- Assembly
- HelixToolkit.SharpDX.dll
public static class UnsafeHelper
- Inheritance
-
UnsafeHelper
- Inherited Members
Methods
ClearMemory(nint, int)
Clears the memory.
public static void ClearMemory(nint dest, int sizeInBytesToClear)
Parameters
MemoryCopy(nint, nint, int)
Unsafe memory copy
public static void MemoryCopy(nint dst, nint src, int sizeInBytes)
Parameters
ReadAndPosition<T>(nint, ref T)
Reads the specified T data from a memory location.
public static nint ReadAndPosition<T>(nint source, ref T data) where T : unmanaged
Parameters
sourcenintMemory location to read from.
dataTThe data write to.
Returns
- nint
source pointer + sizeof(T).
Type Parameters
TType of a data to read.
ReadOut<T>(nint, out T)
Reads the specified T data from a memory location.
public static void ReadOut<T>(nint source, out T data) where T : unmanaged
Parameters
sourcenintMemory location to read from.
dataTThe data write to.
Type Parameters
TType of a data to read.
Read<T>(nint)
Reads the specified T data from a memory location.
public static T Read<T>(nint source) where T : unmanaged
Parameters
sourcenintMemory location to read from.
Returns
- T
The data read from the memory location.
Type Parameters
TType of a data to read.
Read<T>(nint, ref T)
Reads the specified T data from a memory location.
public static void Read<T>(nint source, ref T data) where T : unmanaged
Parameters
sourcenintMemory location to read from.
dataTThe data write to.
Type Parameters
TType of a data to read.
Read<T>(nint, T[], int, int)
Reads the specified array T[] data from a memory location.
public static nint Read<T>(nint source, T[] data, int offset, int count) where T : unmanaged
Parameters
sourcenintMemory location to read from.
dataT[]The data write to.
offsetintThe offset in the array to write to.
countintThe number of T element to read from the memory location.
Returns
- nint
source pointer + sizeof(T) * count.
Type Parameters
TType of a data to read.
SizeOf<T>()
public static int SizeOf<T>() where T : unmanaged
Returns
Type Parameters
T
SizeOf<T>(ref T)
public static int SizeOf<T>(ref T _) where T : unmanaged
Parameters
_T
Returns
Type Parameters
T
SizeOf<T>(T[])
public static int SizeOf<T>(T[] array) where T : unmanaged
Parameters
arrayT[]
Returns
Type Parameters
T
Write(nint, nint, int, int)
public static nint Write(nint destination, nint data, int offset, int count)
Parameters
Returns
Write<T>(nint, T)
Writes the specified T data to a memory location.
public static nint Write<T>(nint destination, T data) where T : unmanaged
Parameters
destinationnintMemory location to write to.
dataTThe data to write.
Returns
- nint
destination pointer + sizeof(T).
Type Parameters
TType of a data to write.
Write<T>(nint, ref T)
Writes the specified T data to a memory location.
public static nint Write<T>(nint destination, ref T data) where T : unmanaged
Parameters
destinationnintMemory location to write to.
dataTThe data to write.
Returns
- nint
destination pointer + sizeof(T).
Type Parameters
TType of a data to write.
Write<T>(nint, T[], int, int)
Writes the specified array T[] data to a memory location.
public static nint Write<T>(nint destination, T[] data, int offset, int count) where T : unmanaged
Parameters
destinationnintMemory location to write to.
dataT[]The array of T data to write.
offsetintThe offset in the array to read from.
countintThe number of T element to write to the memory location.
Returns
- nint
destination pointer + sizeof(T) * count.
Type Parameters
TType of a data to write.