Class ObjectMarshaller
- Namespace
- Echo.Platforms.AsmResolver.Emulation
- Assembly
- Echo.Platforms.AsmResolver.dll
Provides an implementation of the IObjectMarshaller, that embeds managed objects into the ObjectMapMemory of the virtual machine.
public class ObjectMarshaller : IObjectMarshaller
- Inheritance
-
ObjectMarshaller
- Implements
- Inherited Members
- Extension Methods
Constructors
ObjectMarshaller(CilVirtualMachine)
Creates a new marshaller for the provided virtual machine.
public ObjectMarshaller(CilVirtualMachine machine)
Parameters
machineCilVirtualMachineThe machine.
Properties
Machine
Gets the machine the marshaller is targeting.
public CilVirtualMachine Machine { get; }
Property Value
Methods
DeserializeObject(long, Type)
Deserialize the provided object address to an object of the provided type.
protected virtual object DeserializeObject(long pointer, Type targetType)
Parameters
pointerlongThe pointer to the beginning of the object.
targetTypeTypeThe type of object to deserialize.
Returns
- object
The deserialized object.
DeserializeStructure(BitVectorSpan, Type)
Deserialize the provided bit vector to a structure of the provided type.
protected virtual object DeserializeStructure(BitVectorSpan data, Type targetType)
Parameters
dataBitVectorSpanThe raw data of the structure
targetTypeTypeThe type of object to deserialize.
Returns
- object
The deserialized object.
ToBitVector(object?)
Constructs a bit vector that represents the provided object.
public virtual BitVector ToBitVector(object? obj)
Parameters
objobjectThe object.
Returns
- BitVector
The bitvector containing the address to the object.
ToObject(BitVectorSpan, Type)
Interprets the provided bit vector as an object of the provided type.
public virtual object? ToObject(BitVectorSpan vector, Type targetType)
Parameters
vectorBitVectorSpanThe vector.
targetTypeTypeThe type to marshal to.
Returns
- object
The marshalled object.