Quantum 3 3.1.0

Public Member Functions | List of all members
Photon.Deterministic.Native.Utility Class Reference

Represents a collection of memory utility functions that interact with the platform's native code directly. More...

Inheritance diagram for Photon.Deterministic.Native.Utility:
Photon.Deterministic.Native.LIBCUtility Photon.Deterministic.Native.MSVCRTUtility

Public Member Functions

void Clear (void *dest, int count)
 Writes the desired number zeroed bytes to the specified memory location. More...
 
int Compare (void *ptr1, void *ptr2, int count)
 Compares the first count bytes of these arrays. The comparison is done lexicographically. More...
 
void Copy (void *dest, void *src, int count)
 Copies count bytes from the object pointed to by src to the object pointed to by dest. More...
 
void Copy< T > (T *dest, T *src)
 Copies value from the object pointed to by src to the object pointed to by dest. More...
 
void Move (void *dest, void *src, int count)
 Copies count characters from the object pointed to by src to the object pointed to by dest. More...
 
T Replace< T > (T *x, T value)
 Replaces the value at x with value and returns the replaced value. More...
 
void Set (void *dest, byte value, int count)
 Copies the value into each of the first count characters of the object pointed to by dest. More...
 
void Swap (void *a, void *b, int count)
 Swaps count bytes between two locations in memory. More...
 
void Swap< T > (T *a, T *b)
 Swaps values between two locations in memory. More...
 

Detailed Description

Represents a collection of memory utility functions that interact with the platform's native code directly.

Member Function Documentation

◆ Copy()

void Photon.Deterministic.Native.Utility.Copy ( void *  dest,
void *  src,
int  count 
)

Copies count bytes from the object pointed to by src to the object pointed to by dest.

Parameters
destPointer to the memory location to copy to.
srcPointer to the memory location to copy from.
countNumber of bytes to copy.

◆ Clear()

void Photon.Deterministic.Native.Utility.Clear ( void *  dest,
int  count 
)

Writes the desired number zeroed bytes to the specified memory location.

Parameters
destPointer to the object to fill.
countNumber of bytes to write.

◆ Move()

void Photon.Deterministic.Native.Utility.Move ( void *  dest,
void *  src,
int  count 
)

Copies count characters from the object pointed to by src to the object pointed to by dest.

Parameters
destPointer to the memory location to copy to.
srcPointer to the memory location to copy from.
countNumber of bytes to copy.

◆ Set()

void Photon.Deterministic.Native.Utility.Set ( void *  dest,
byte  value,
int  count 
)

Copies the value into each of the first count characters of the object pointed to by dest.

Parameters
destPinter to the object to fill.
valueThe byte to write.
countNumber of bytes to write.

◆ Compare()

int Photon.Deterministic.Native.Utility.Compare ( void *  ptr1,
void *  ptr2,
int  count 
)

Compares the first count bytes of these arrays. The comparison is done lexicographically.

Parameters
ptr1Pointers to the left hand side memory buffers to compare.
ptr2Pointers to the right hand side memory buffers to compare.
countNumber of bytes to examine.
Returns
Negative value if the first differing byte in ptr1 is less than the corresponding byte in ptr2 . 0​ if all count bytes of ptr1 and ptr2 are equal. Positive value if the first differing byte in ptr1 is greater than the corresponding byte in ptr2 .

◆ Copy< T >()

void Photon.Deterministic.Native.Utility.Copy< T > ( T *  dest,
T *  src 
)

Copies value from the object pointed to by src to the object pointed to by dest.

Parameters
destPointer to the memory location to copy to.
srcPointer to the memory location to copy from.
Type Constraints
T :unmanaged 
T :QuantumUnsafe.Copy 
T :dest 
T :src 
T :sizeof 
T :T 

◆ Swap()

void Photon.Deterministic.Native.Utility.Swap ( void *  a,
void *  b,
int  count 
)

Swaps count bytes between two locations in memory.

Parameters
aPointer to the first location in memory.
bPointer to the second location in memory.
countThe number of bytes to swap.

◆ Swap< T >()

void Photon.Deterministic.Native.Utility.Swap< T > ( T *  a,
T *  b 
)

Swaps values between two locations in memory.

Parameters
aPointer to the first location in memory.
bPointer to the second location in memory.
Type Constraints
T :unmanaged 
T :QuantumUnsafe.Swap 
T :a 
T :b 

◆ Replace< T >()

T Photon.Deterministic.Native.Utility.Replace< T > ( T *  x,
T  value 
)

Replaces the value at x with value and returns the replaced value.

Parameters
xPointer to an existing value.
valueThe new value to write.
Returns
The original value at x.
Type Constraints
T :unmanaged 
T :QuantumUnsafe.Replace 
T :x 
T :value