Class Delegate

java.lang.Object
net.codecrete.windowsapi.metadata.Type
net.codecrete.windowsapi.metadata.Delegate

public final class Delegate extends Type
Delegate type (aka as function pointer or callback functions).

Defines the signature of a function pointer.

  • Constructor Details

    • Delegate

      public Delegate(String name, Namespace namespace, int typeDefIndex)
      Creates a new instance.
      Parameters:
      name - the delegate name
      namespace - the delegate's namespace
      typeDefIndex - the TypeDef index
  • Method Details

    • signature

      public Method signature()
      Returns the delegate's signature.

      The return Method instance defines the return type and parameters. Most of the remaining method attributes can be ignored.

      Returns:
      the signature (as a method)
    • setSignature

      public void setSignature(Method signature)
      Sets the delegate signature.
      Parameters:
      signature - the signature (as a method)
    • referencedTypes

      public Stream<Type> referencedTypes()
      Description copied from class: Type
      Returns the types directly references by this type.
      Overrides:
      referencedTypes in class Type
      Returns:
      Stream of types
    • replaceTypes

      public void replaceTypes(UnaryOperator<Type> typeReplacements)
      Description copied from class: Type
      Replace the types directly referenced by this type with the provided replacements.

      The lambda for replacement lookup will return the same type if no replacement is needed.

      Overrides:
      replaceTypes in class Type
      Parameters:
      typeReplacements - lambda for looking up the replacement type.