SemPtr SemPtr
SemPtr SemPtr
Documentation generated with DocFX
Using SingulinkFX as the template

Search Results for

    Edit this page

    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.

    Inheritance
    object
    Attribute
    FunctionPointerAttribute<TDelegate>
    Inherited Members
    Attribute.Equals(object)
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, bool)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, bool)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, bool)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, bool)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, bool)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, bool)
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, bool)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, bool)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, bool)
    Attribute.GetHashCode()
    Attribute.IsDefaultAttribute()
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, bool)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, bool)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, bool)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, bool)
    Attribute.Match(object)
    Attribute.TypeId
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    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 extension members for.

    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 extension members for invoking the function pointer.

    © 2026 Felix Rüdiger. SemPtr and its documentation are licensed under the MIT license.