![]() |
Paradox Game Engine
v1.0.0 beta06
|
Utility class. More...
Static Public Member Functions | |
static void | CopyMemory (IntPtr dest, IntPtr src, int sizeInBytesToCopy) |
static void | CopyMemory (IntPtr dest, IntPtr src, int sizeInBytesToCopy) |
static unsafe bool | CompareMemory (IntPtr from, IntPtr against, int sizeToCompare) |
Compares two block of memory. More... | |
static void | ClearMemory (IntPtr dest, byte value, int sizeInBytesToClear) |
Clears the memory. More... | |
static int | SizeOf< T > () |
Return the sizeof a struct from a CLR. Equivalent to sizeof operator but works on generics too. More... | |
static int | SizeOf< T > (T[] array) |
Return the sizeof an array of struct. Equivalent to sizeof operator but works on generics too. More... | |
static void | Pin< T > (ref T source, Action< IntPtr > pinAction) |
Pins the specified source and call an action with the pinned pointer. More... | |
static void | Pin< T > (T[] source, Action< IntPtr > pinAction) |
Pins the specified source and call an action with the pinned pointer. More... | |
static byte[] | ToByteArray< T > (T[] source) |
Covnerts a structured array to an equivalent byte array. More... | |
static T | Read< T > (IntPtr source) |
Reads the specified T data from a memory location. More... | |
static void | Read< T > (IntPtr source, ref T data) |
Reads the specified T data from a memory location. More... | |
static void | ReadOut< T > (IntPtr source, out T data) |
Reads the specified T data from a memory location. More... | |
static IntPtr | ReadAndPosition< T > (IntPtr source, ref T data) |
Reads the specified T data from a memory location. More... | |
static IntPtr | Read< T > (IntPtr source, T[] data, int offset, int count) |
Reads the specified array T[] data from a memory location. More... | |
static void | Write< T > (IntPtr destination, ref T data) |
Writes the specified T data to a memory location. More... | |
static IntPtr | WriteAndPosition< T > (IntPtr destination, ref T data) |
Writes the specified T data to a memory location. More... | |
static void | Write< T > (byte[] destination, T[] data, int offset, int count) |
Writes the specified array T[] data to a memory location. More... | |
static IntPtr | Write< T > (IntPtr destination, T[] data, int offset, int count) |
Writes the specified array T[] data to a memory location. More... | |
static unsafe IntPtr | AllocateMemory (int sizeInBytes, int align=16) |
Allocate an aligned memory buffer. More... | |
static IntPtr | AllocateClearedMemory (int sizeInBytes, byte clearValue=0, int align=16) |
Allocate an aligned memory buffer and clear it with a specified value (0 by defaault). More... | |
static bool | IsMemoryAligned (IntPtr memoryPtr, int align=16) |
Determines whether the specified memory pointer is aligned in memory. More... | |
static unsafe void | FreeMemory (IntPtr alignedBuffer) |
Allocate an aligned memory buffer. More... | |
static void | Dispose< T > (ref T disposable) |
If non-null, disposes the specified object and set it to null, otherwise do nothing. More... | |
static string | Join< T > (string separator, T[] array) |
String helper join method to display an array of object as a single string. More... | |
static string | Join (string separator, IEnumerable elements) |
String helper join method to display an enumrable of object as a single string. More... | |
static string | Join (string separator, IEnumerator elements) |
String helper join method to display an enumrable of object as a single string. More... | |
static byte[] | ReadStream (Stream stream) |
Read stream to a byte[] buffer More... | |
static byte[] | ReadStream (Stream stream, ref int readLength) |
Read stream to a byte[] buffer More... | |
static int | GetHashCode (IDictionary dict) |
Computes a hashcode for a dictionary. More... | |
static int | GetHashCode (IEnumerable it) |
Computes a hashcode for an enumeration More... | |
static int | GetHashCode (IEnumerator it) |
Computes a hashcode for an enumeration More... | |
static bool | Compare (IEnumerable left, IEnumerable right) |
Compares two collection, element by elements. More... | |
static bool | Compare (IEnumerator leftIt, IEnumerator rightIt) |
Compares two collection, element by elements. More... | |
static bool | Compare< TKey, TValue > (IDictionary< TKey, TValue > first, IDictionary< TKey, TValue > second) |
Compares two collection, element by elements. More... | |
static bool | Compare< T > (ICollection< T > left, ICollection< T > right) |
Compares two collection, element by elements. More... | |
static void | Swap< T > (ref T left, ref T right) |
Swaps the value between two references. More... | |
static void | Sleep (TimeSpan sleepTime) |
Suspends the current thread of a sleepTimeInMillis. More... | |
static void | Sleep (int sleepTimeInMillis) |
Suspends the current thread of a sleepTimeInMillis. More... | |
Utility class.
Definition at line 13 of file Utilities.cs.
|
static |
Allocate an aligned memory buffer and clear it with a specified value (0 by defaault).
sizeInBytes | Size of the buffer to allocate. |
clearValue | Default value used to clear the buffer. |
align | Alignment, 16 bytes by default. |
To free this buffer, call FreeMemory
Definition at line 373 of file Utilities.cs.
|
static |
Allocate an aligned memory buffer.
sizeInBytes | Size of the buffer to allocate. |
align | Alignment, 16 bytes by default. |
To free this buffer, call FreeMemory
Definition at line 354 of file Utilities.cs.
|
static |
Clears the memory.
dest | The dest. |
value | The value. |
sizeInBytesToClear | The size in bytes to clear. |
Definition at line 122 of file Utilities.cs.
|
static |
Compares two collection, element by elements.
left | A "from" enumerator. |
right | A "to" enumerator. |
Definition at line 584 of file Utilities.cs.
Referenced by SiliconStudio.Paradox.Shaders.ShaderClassSource.Equals(), and SiliconStudio.Paradox.Shaders.ShaderMixinSource.Equals().
|
static |
Compares two collection, element by elements.
leftIt | A "from" enumerator. |
rightIt | A "to" enumerator. |
Definition at line 600 of file Utilities.cs.
|
static |
Compares two collection, element by elements.
left | The collection to compare from. |
right | The colllection to compare to. |
Definition at line 658 of file Utilities.cs.
References DirectX.count.
|
static |
Compares two collection, element by elements.
first | The collection to compare from. |
second | The colllection to compare to. |
Definition at line 633 of file Utilities.cs.
|
static |
Compares two block of memory.
from | The pointer to compare from. |
against | The pointer to compare against. |
sizeToCompare | The size in bytes to compare. |
Definition at line 86 of file Utilities.cs.
|
static |
Definition at line 19 of file Utilities.cs.
|
static |
Definition at line 73 of file Utilities.cs.
|
static |
If non-null, disposes the specified object and set it to null, otherwise do nothing.
disposable | The disposable. |
T | : | class | |
T | : | IDisposable |
Definition at line 407 of file Utilities.cs.
|
static |
Allocate an aligned memory buffer.
The buffer must have been allocated with AllocateMemory
Definition at line 398 of file Utilities.cs.
|
static |
Computes a hashcode for a dictionary.
Definition at line 527 of file Utilities.cs.
Referenced by SiliconStudio.Paradox.Shaders.ShaderMixinSource.GetHashCode().
|
static |
Computes a hashcode for an enumeration
it | An enumerator. |
Definition at line 546 of file Utilities.cs.
|
static |
Computes a hashcode for an enumeration
it | An enumerator. |
Definition at line 564 of file Utilities.cs.
|
static |
Determines whether the specified memory pointer is aligned in memory.
memoryPtr | The memory pointer. |
align | The align. |
true
if the specified memory pointer is aligned in memory; otherwise, false
.Definition at line 386 of file Utilities.cs.
Referenced by SiliconStudio.Core.ObjectCollector.Add< T >().
|
static |
String helper join method to display an enumrable of object as a single string.
separator | The separator. |
elements | The enumerable. |
Definition at line 442 of file Utilities.cs.
|
static |
String helper join method to display an enumrable of object as a single string.
separator | The separator. |
elements | The enumerable. |
Definition at line 464 of file Utilities.cs.
|
static |
String helper join method to display an array of object as a single string.
separator | The separator. |
array | The array. |
Definition at line 422 of file Utilities.cs.
|
static |
Pins the specified source and call an action with the pinned pointer.
T | The type of the structure to pin |
source | The source. |
pinAction | The pin action to perform on the pinned pointer. |
T | : | struct |
Definition at line 157 of file Utilities.cs.
|
static |
Pins the specified source and call an action with the pinned pointer.
T | The type of the structure to pin |
source | The source array. |
pinAction | The pin action to perform on the pinned pointer. |
T | : | struct |
Definition at line 171 of file Utilities.cs.
|
static |
Reads the specified T data from a memory location.
T | Type of a data to read |
source | Memory location to read from. |
T | : | struct |
Definition at line 208 of file Utilities.cs.
|
static |
Reads the specified T data from a memory location.
T | Type of a data to read |
source | Memory location to read from. |
data | The data write to. |
T | : | struct |
Definition at line 223 of file Utilities.cs.
|
static |
Reads the specified array T[] data from a memory location.
T | Type of a data to read |
source | Memory location to read from. |
data | The data write to. |
offset | The offset in the array to write to. |
count | The number of T element to read from the memory location |
T | : | struct |
Definition at line 270 of file Utilities.cs.
References DirectX.count.
|
static |
Reads the specified T data from a memory location.
T | Type of a data to read |
source | Memory location to read from. |
data | The data write to. |
T | : | struct |
Definition at line 253 of file Utilities.cs.
|
static |
Reads the specified T data from a memory location.
T | Type of a data to read |
source | Memory location to read from. |
data | The data write to. |
T | : | struct |
Definition at line 238 of file Utilities.cs.
|
static |
Read stream to a byte[] buffer
stream | input stream |
Definition at line 485 of file Utilities.cs.
Referenced by SiliconStudio.Paradox.Graphics.Image.Load().
|
static |
Read stream to a byte[] buffer
stream | input stream |
readLength | length to read |
Definition at line 497 of file Utilities.cs.
|
static |
Return the sizeof a struct from a CLR. Equivalent to sizeof operator but works on generics too.
T | a struct to evaluate |
T | : | struct |
Definition at line 135 of file Utilities.cs.
|
static |
Return the sizeof an array of struct. Equivalent to sizeof operator but works on generics too.
T | a struct |
array | The array of struct to evaluate. |
T | : | struct |
Definition at line 146 of file Utilities.cs.
|
static |
Suspends the current thread of a sleepTimeInMillis.
sleepTime | The duration to sleep. |
Definition at line 704 of file Utilities.cs.
|
static |
Suspends the current thread of a sleepTimeInMillis.
sleepTimeInMillis | The duration to sleep in milliseconds. |
Definition at line 717 of file Utilities.cs.
|
static |
Swaps the value between two references.
T | Type of a data to swap. |
left | The left value. |
right | The right value. |
Definition at line 693 of file Utilities.cs.
|
static |
Covnerts a structured array to an equivalent byte array.
T |
source | The source. |
T | : | struct |
Definition at line 185 of file Utilities.cs.
|
static |
Writes the specified T data to a memory location.
T | Type of a data to write |
destination | Memory location to write to. |
data | The data to write. |
T | : | struct |
Definition at line 285 of file Utilities.cs.
|
static |
Writes the specified array T[] data to a memory location.
T | Type of a data to write |
destination | Memory location to write to. |
data | The array of T data to write. |
offset | The offset in the array to read from. |
count | The number of T element to write to the memory location |
T | : | struct |
Definition at line 317 of file Utilities.cs.
References DirectX.count.
|
static |
Writes the specified array T[] data to a memory location.
T | Type of a data to write |
destination | Memory location to write to. |
data | The array of T data to write. |
offset | The offset in the array to read from. |
count | The number of T element to write to the memory location |
T | : | struct |
Definition at line 337 of file Utilities.cs.
References DirectX.count.
|
static |
Writes the specified T data to a memory location.
T | Type of a data to write |
destination | Memory location to write to. |
data | The data to write. |
T | : | struct |
Definition at line 300 of file Utilities.cs.