Photon Quantum 3.0.0

Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Quantum.MemoryLayoutVerifier Class Reference

Verifies the memory layout of types and detects any potential issues. More...

Classes

class  DefaultPlatform
 The default platform implementation. More...
 
interface  IPlatform
 Represents a platform that can resolve the memory layout of types and detect any potential issues. More...
 

Public Member Functions

 MemoryLayoutVerifier (IPlatform platform)
 Creates a new instance of the MemoryLayoutVerifier class. More...
 

Static Public Member Functions

static int GetFieldOffset (FieldInfo field)
 Returns the offset of a field in memory. More...
 
static ? int GetFieldOverlap (FieldInfo field)
 Gets the overlap offset of a field. More...
 
static bool IsFixedBuffer (FieldInfo field)
 Checks if a field is a fixed buffer. More...
 

Static Public Attributes

static IPlatform Platform
 The current platform used to resolve memory layout. More...
 

Detailed Description

Verifies the memory layout of types and detects any potential issues.

Constructor & Destructor Documentation

◆ MemoryLayoutVerifier()

Quantum.MemoryLayoutVerifier.MemoryLayoutVerifier ( IPlatform  platform)
inline

Creates a new instance of the MemoryLayoutVerifier class.

Member Function Documentation

◆ IsFixedBuffer()

static bool Quantum.MemoryLayoutVerifier.IsFixedBuffer ( FieldInfo  field)
inlinestatic

Checks if a field is a fixed buffer.

Parameters
fieldThe field to inspect.
Returns
true if the field is a fixed buffer; false otherwise

◆ GetFieldOffset()

static int Quantum.MemoryLayoutVerifier.GetFieldOffset ( FieldInfo  field)
inlinestatic

Returns the offset of a field in memory.

Parameters
fieldThe field for which to retrieve the offset.
Returns
The offset of the field in memory.
Exceptions
ExceptionThrown if the field does not have the [FieldOffset] attribute.

◆ GetFieldOverlap()

static ? int Quantum.MemoryLayoutVerifier.GetFieldOverlap ( FieldInfo  field)
inlinestatic

Gets the overlap offset of a field.

Parameters
fieldThe field for which to get the overlap offset.
Returns
The overlap offset of the field, or null if no overlap is specified.

Member Data Documentation

◆ Platform

IPlatform Quantum.MemoryLayoutVerifier.Platform
static

The current platform used to resolve memory layout.