Class FunctionPointerAttribute<TDelegate>
Indicates that the source generator should generate extension members for all function pointer types for the specified delegate type,
using the optionally specified CallConvs as the calling conventions of the target function that is invoked by the generated method.
Inherited Members
Namespace: SemPtr
Assembly: SemPtr.dll
Syntax
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
public sealed class FunctionPointerAttribute<TDelegate> : Attribute where TDelegate : notnull, Delegate
Type Parameters
| Name | Description |
|---|---|
| TDelegate | The type of the delegate for which the source generator should generate |
Remarks
Forces the source generator to generate extension members for all function pointer types for the specified TDelegate.
You can specify the CallConvs property to indicate the calling conventions of the target function that is invoked by the generated method. Specifying this property takes priority over any UnmanagedFunctionPointerAttribute that may be applied to the target delegate type.
This attribute can be applied at the assembly level multiple times, though each application must specify a different concrete TDelegate type.
Note that the target TDelegate type must be at least internally accessible.
You can specify this attribute with externally defined delegate types by applying it at the assembly level and as long as the TDelegate is accessible from the assembly where the attribute is applied.
If you control the source code of the TDelegate, you can alternatively specify a FunctionPointerAttribute attribute on the delegate type declaration itself to achieve the same effect.
Properties
| Name | Description |
|---|---|
| CallConvs | Gets or initializes the calling conventions that should be used for the generated |