Class MemoryExtensions
- Namespace
- CarinaStudio
- Assembly
- CarinaStudio.AppBase.Core.dll
Extensions for Memory<T>.
public static class MemoryExtensions
- Inheritance
-
MemoryExtensions
- Inherited Members
Methods
IsEmptyOrWhiteSpace(Memory<char>)
Check whether given character sequence is empty or contains whitespaces only or not.
public static bool IsEmptyOrWhiteSpace(this Memory<char> s)
Parameters
Returns
- bool
True if the character sequence is empty or contains whitespaces only.
IsEmptyOrWhiteSpace(ReadOnlyMemory<char>)
Check whether given character sequence is empty or contains whitespaces only or not.
public static bool IsEmptyOrWhiteSpace(this ReadOnlyMemory<char> s)
Parameters
sReadOnlyMemory<char>Character sequence to check.
Returns
- bool
True if the character sequence is empty or contains whitespaces only.
IsNotEmpty<T>(Memory<T>)
Check whether given Memory<T> contains data or not.
public static bool IsNotEmpty<T>(this Memory<T> memory)
Parameters
Returns
Type Parameters
TType of memory element.
IsNotEmpty<T>(ReadOnlyMemory<T>)
Check whether given ReadOnlyMemory<T> contains data or not.
public static bool IsNotEmpty<T>(this ReadOnlyMemory<T> memory)
Parameters
memoryReadOnlyMemory<T>ReadOnlyMemory<T> to check.
Returns
- bool
True if ReadOnlyMemory<T> contains data.
Type Parameters
TType of memory element.
IsNotWhiteSpace(Memory<char>)
Check whether given character sequence contains at least one non-whitespace or not.
public static bool IsNotWhiteSpace(this Memory<char> s)
Parameters
Returns
- bool
True if the character sequence contains contains at least one non-whitespace.
IsNotWhiteSpace(ReadOnlyMemory<char>)
Check whether given character sequence contains at least one non-whitespace or not.
public static bool IsNotWhiteSpace(this ReadOnlyMemory<char> s)
Parameters
sReadOnlyMemory<char>Character sequence to check.
Returns
- bool
True if the character sequence contains contains at least one non-whitespace.
PinAs<T, TPtr>(Memory<T>, PointerAction<TPtr>)
Pin given Memory<T>, get address of memory and perform action.
public static void PinAs<T, TPtr>(this Memory<T> memory, PointerAction<TPtr> action) where TPtr : unmanaged
Parameters
memoryMemory<T>actionPointerAction<TPtr>Method to receive address of memory and perform action.
Type Parameters
TType of memory element.
TPtrType of pointer of pinned memory element.
PinAs<T, TPtr>(ReadOnlyMemory<T>, PointerAction<TPtr>)
Pin given ReadOnlyMemory<T>, get address of memory and perform action.
public static void PinAs<T, TPtr>(this ReadOnlyMemory<T> memory, PointerAction<TPtr> action) where TPtr : unmanaged
Parameters
memoryReadOnlyMemory<T>actionPointerAction<TPtr>Method to receive address of memory and perform action.
Type Parameters
TType of memory element.
TPtrType of pointer of pinned memory element.
PinAs<T, TPtr, R>(Memory<T>, PointerInFunc<TPtr, R>)
Pin given Memory<T>, get address of memory and generate a value.
public static R PinAs<T, TPtr, R>(this Memory<T> memory, PointerInFunc<TPtr, R> func) where TPtr : unmanaged
Parameters
memoryMemory<T>funcPointerInFunc<TPtr, R>Function to receive address of memory and generate value.
Returns
- R
Generated value.
Type Parameters
TType of memory element.
TPtrType of pointer of pinned memory element.
RType of generated value.
PinAs<T, TPtr, R>(ReadOnlyMemory<T>, PointerInFunc<TPtr, R>)
Pin given ReadOnlyMemory<T>, get address of memory and generate a value.
public static R PinAs<T, TPtr, R>(this ReadOnlyMemory<T> memory, PointerInFunc<TPtr, R> func) where TPtr : unmanaged
Parameters
memoryReadOnlyMemory<T>funcPointerInFunc<TPtr, R>Function to receive address of memory and generate value.
Returns
- R
Generated value.
Type Parameters
TType of memory element.
TPtrType of pointer of pinned memory element.
RType of generated value.
PinAs<T1, T2, TPtr1, TPtr2>((Memory<T1>, Memory<T2>), PointerAction<TPtr1, TPtr2>)
Pin given list of Memory<T>, get addresses of memory and perform action.
public static void PinAs<T1, T2, TPtr1, TPtr2>(this (Memory<T1>, Memory<T2>) memoryList, PointerAction<TPtr1, TPtr2> action) where TPtr1 : unmanaged where TPtr2 : unmanaged
Parameters
memoryList(Memory<T1>, Memory<T2>)List of Memory<T>.
actionPointerAction<TPtr1, TPtr2>Method to receive addresses of memory and perform action.
Type Parameters
T1Type of 1st memory element.
T2Type of 2nd memory element.
TPtr1Type of 1st pointer of pinned memory element.
TPtr2Type of 2nd pointer of pinned memory element.
PinAs<T1, T2, TPtr1, TPtr2>((ReadOnlyMemory<T1>, ReadOnlyMemory<T2>), PointerAction<TPtr1, TPtr2>)
Pin given list of ReadOnlyMemory<T>, get addresses of memory and perform action.
public static void PinAs<T1, T2, TPtr1, TPtr2>(this (ReadOnlyMemory<T1>, ReadOnlyMemory<T2>) memoryList, PointerAction<TPtr1, TPtr2> action) where TPtr1 : unmanaged where TPtr2 : unmanaged
Parameters
memoryList(ReadOnlyMemory<T1>, ReadOnlyMemory<T2>)List of ReadOnlyMemory<T>.
actionPointerAction<TPtr1, TPtr2>Method to receive addresses of memory and perform action.
Type Parameters
T1Type of 1st memory element.
T2Type of 2nd memory element.
TPtr1Type of 1st pointer of pinned memory element.
TPtr2Type of 2nd pointer of pinned memory element.
PinAs<T1, T2, TPtr1, TPtr2, R>((Memory<T1>, Memory<T2>), PointerInFunc<TPtr1, TPtr2, R>)
Pin given list of Memory<T>, get addresses of memory and generate a value.
public static R PinAs<T1, T2, TPtr1, TPtr2, R>(this (Memory<T1>, Memory<T2>) memoryList, PointerInFunc<TPtr1, TPtr2, R> func) where TPtr1 : unmanaged where TPtr2 : unmanaged
Parameters
memoryList(Memory<T1>, Memory<T2>)List of Memory<T>.
funcPointerInFunc<TPtr1, TPtr2, R>Function to receive addresses of memory and generate value.
Returns
- R
Generated value.
Type Parameters
T1Type of 1st memory element.
T2Type of 2nd memory element.
TPtr1Type of 1st pointer of pinned memory element.
TPtr2Type of 2nd pointer of pinned memory element.
RType of generated value.
PinAs<T1, T2, TPtr1, TPtr2, R>((ReadOnlyMemory<T1>, ReadOnlyMemory<T2>), PointerInFunc<TPtr1, TPtr2, R>)
Pin given list of ReadOnlyMemory<T>, get addresses of memory and generate a value.
public static R PinAs<T1, T2, TPtr1, TPtr2, R>(this (ReadOnlyMemory<T1>, ReadOnlyMemory<T2>) memoryList, PointerInFunc<TPtr1, TPtr2, R> func) where TPtr1 : unmanaged where TPtr2 : unmanaged
Parameters
memoryList(ReadOnlyMemory<T1>, ReadOnlyMemory<T2>)List of ReadOnlyMemory<T>.
funcPointerInFunc<TPtr1, TPtr2, R>Function to receive addresses of memory and generate value.
Returns
- R
Generated value.
Type Parameters
T1Type of 1st memory element.
T2Type of 2nd memory element.
TPtr1Type of 1st pointer of pinned memory element.
TPtr2Type of 2nd pointer of pinned memory element.
RType of generated value.
Pin<T>(Memory<T>, Action<IntPtr>)
Pin given Memory<T>, get address of memory and perform action.
public static void Pin<T>(this Memory<T> memory, Action<IntPtr> action)
Parameters
Type Parameters
TType of memory element.
Pin<T>(ReadOnlyMemory<T>, Action<IntPtr>)
Pin given ReadOnlyMemory<T>, get address of memory and perform action.
public static void Pin<T>(this ReadOnlyMemory<T> memory, Action<IntPtr> action)
Parameters
memoryReadOnlyMemory<T>actionAction<IntPtr>Method to receive address of memory and perform action.
Type Parameters
TType of memory element.
Pin<T, R>(Memory<T>, Func<IntPtr, R>)
Pin given Memory<T>, get address of memory and generate a value.
public static R Pin<T, R>(this Memory<T> memory, Func<IntPtr, R> func)
Parameters
Returns
- R
Generated value.
Type Parameters
TType of memory element.
RType of generated value.
Pin<T, R>(ReadOnlyMemory<T>, Func<IntPtr, R>)
Pin given ReadOnlyMemory<T>, get address of memory and generate a value.
public static R Pin<T, R>(this ReadOnlyMemory<T> memory, Func<IntPtr, R> func)
Parameters
memoryReadOnlyMemory<T>funcFunc<IntPtr, R>Function to receive address of memory and generate value.
Returns
- R
Generated value.
Type Parameters
TType of memory element.
RType of generated value.
Pin<T1, T2>((Memory<T1>, Memory<T2>), Action<IntPtr, IntPtr>)
Pin given list of Memory<T>, get addresses of memory and perform action.
public static void Pin<T1, T2>(this (Memory<T1>, Memory<T2>) memoryList, Action<IntPtr, IntPtr> action)
Parameters
memoryList(Memory<T1>, Memory<T2>)List of Memory<T>.
actionAction<IntPtr, IntPtr>Method to receive addresses of memory and perform action.
Type Parameters
T1Type of 1st memory element.
T2Type of 2nd memory element.
Pin<T1, T2>((ReadOnlyMemory<T1>, ReadOnlyMemory<T2>), Action<IntPtr, IntPtr>)
Pin given list of ReadOnlyMemory<T>, get addresses of memory and perform action.
public static void Pin<T1, T2>(this (ReadOnlyMemory<T1>, ReadOnlyMemory<T2>) memoryList, Action<IntPtr, IntPtr> action)
Parameters
memoryList(ReadOnlyMemory<T1>, ReadOnlyMemory<T2>)List of ReadOnlyMemory<T>.
actionAction<IntPtr, IntPtr>Method to receive addresses of memory and perform action.
Type Parameters
T1Type of 1st memory element.
T2Type of 2nd memory element.
Pin<T1, T2, R>((Memory<T1>, Memory<T2>), Func<IntPtr, IntPtr, R>)
Pin given list of Memory<T>, get addresses of memory and generate a value.
public static R Pin<T1, T2, R>(this (Memory<T1>, Memory<T2>) memoryList, Func<IntPtr, IntPtr, R> func)
Parameters
memoryList(Memory<T1>, Memory<T2>)List of Memory<T>.
funcFunc<IntPtr, IntPtr, R>Function to receive addresses of memory and generate value.
Returns
- R
Generated value.
Type Parameters
T1Type of 1st memory element.
T2Type of 2nd memory element.
RType of generated value.
Pin<T1, T2, R>((ReadOnlyMemory<T1>, ReadOnlyMemory<T2>), Func<IntPtr, IntPtr, R>)
Pin given list of ReadOnlyMemory<T>, get addresses of memory and generate a value.
public static R Pin<T1, T2, R>(this (ReadOnlyMemory<T1>, ReadOnlyMemory<T2>) memoryList, Func<IntPtr, IntPtr, R> func)
Parameters
memoryList(ReadOnlyMemory<T1>, ReadOnlyMemory<T2>)List of ReadOnlyMemory<T>.
funcFunc<IntPtr, IntPtr, R>Function to receive addresses of memory and generate value.
Returns
- R
Generated value.
Type Parameters
T1Type of 1st memory element.
T2Type of 2nd memory element.
RType of generated value.