Table of Contents

Class FunctionPointerTypeSignature

Namespace
AsmResolver.DotNet.Signatures
Assembly
AsmResolver.DotNet.dll

Represents the type of an object referencing a function or method pointer.

public class FunctionPointerTypeSignature : TypeSignature, ITypeDescriptor, IMemberDescriptor, IFullNameProvider, INameProvider, IModuleProvider, IImportable
Inheritance
FunctionPointerTypeSignature
Implements
Inherited Members
Extension Methods

Constructors

FunctionPointerTypeSignature(MethodSignature)

Creates a new function pointer type signature.

public FunctionPointerTypeSignature(MethodSignature signature)

Parameters

signature MethodSignature

The signature of the function pointer.

Properties

ElementType

Gets the element type of the

public override ElementType ElementType { get; }

Property Value

ElementType

IsValueType

Gets a value indicating whether instances of this type are passed on by value or by reference.

public override bool IsValueType { get; }

Property Value

bool

Name

Gets the name of the object.

public override string Name { get; }

Property Value

string

Namespace

Gets the namespace the type resides in.

public override string? Namespace { get; }

Property Value

string

Scope

Gets the resolution scope that defines the type.

public override IResolutionScope? Scope { get; }

Property Value

IResolutionScope

Signature

Gets or sets the signature of the function or method that is referenced by the object.

public MethodSignature Signature { get; set; }

Property Value

MethodSignature

Methods

AcceptVisitor<TResult>(ITypeSignatureVisitor<TResult>)

Visit the current type signature using the provided visitor.

public override TResult AcceptVisitor<TResult>(ITypeSignatureVisitor<TResult> visitor)

Parameters

visitor ITypeSignatureVisitor<TResult>

The visitor to accept.

Returns

TResult

The result the visitor produced after visiting this type signature.

Type Parameters

TResult

The type of result the visitor produces.

AcceptVisitor<TState, TResult>(ITypeSignatureVisitor<TState, TResult>, TState)

Visit the current type signature using the provided visitor.

public override TResult AcceptVisitor<TState, TResult>(ITypeSignatureVisitor<TState, TResult> visitor, TState state)

Parameters

visitor ITypeSignatureVisitor<TState, TResult>

The visitor to accept.

state TState

Additional state.

Returns

TResult

The result the visitor produced after visiting this type signature.

Type Parameters

TState

The type of additional state.

TResult

The type of result the visitor produces.

GetUnderlyingTypeDefOrRef()

Gets the underlying base type signature, without any extra adornments.

public override ITypeDefOrRef? GetUnderlyingTypeDefOrRef()

Returns

ITypeDefOrRef

The base signature.

Remarks

This is not to be confused with GetUnderlyingType(), which may resolve enum types to their underlying type representation.

IsDirectlyCompatibleWith(TypeSignature, SignatureComparer)

Determines whether the current type is directly compatible with the provided type.

protected override bool IsDirectlyCompatibleWith(TypeSignature other, SignatureComparer comparer)

Parameters

other TypeSignature

The other type.

comparer SignatureComparer

The comparer to use for comparing type signatures.

Returns

bool

true if the types are directly compatible, false otherwise.

Remarks

Type compatibility is determined according to the rules in ECMA-335 I.8.7.1., excluding the transitivity rule.

IsImportedInModule(ModuleDefinition)

Determines whether the descriptor of the member is fully imported in the provided module.

public override bool IsImportedInModule(ModuleDefinition module)

Parameters

module ModuleDefinition

The module that is supposed to import the member.

Returns

bool

true if the descriptor of the member is fully imported by the module, false otherwise.

Remarks

This method verifies all references in the descriptor of the member only. It does not verify any additional data or contents (such as a method body) associated to the member.

Resolve()

Resolves the reference to a type definition.

public override TypeDefinition? Resolve()

Returns

TypeDefinition

The resolved type definition, or null if the type could not be resolved.

Remarks

This method can only be invoked if the reference was added to a module.

WriteContents(in BlobSerializationContext)

Serializes the blob (without extra data) to an output stream.

protected override void WriteContents(in BlobSerializationContext context)

Parameters

context BlobSerializationContext