Class WrappedNativeCallback
Keep alive holder to ensure native call back delegates are not destroyed while registered with native code
Namespace: Llvm.NET.Interop
Assembly: Llvm.NET.dll
Syntax
public abstract class WrappedNativeCallback : DisposableObject, IDisposable
Remarks
This generates a holder for a delegate that allows a native function pointer for the delegate to remain valid until the instance of this wrapper is disposed. This is generally only necessary where the native call back must remain valid for an extended period of time. (e.g. beyond the call that provides the callback)
note
This doesn't actually pin the delegate, but it does add an additional reference see: https://msdn.microsoft.com/en-us/library/367eeye0.aspx for more info.
Constructors
WrappedNativeCallback(Delegate) | Initializes a new instance of the WrappedNativeCallback class. |
Methods
Dispose(Boolean) | Abstract method that is implemented by derived types to perform the dispose operation |
ToDelegate<T>() | Gets a delegate from the raw native callback |
ToIntPtr() | Gets the raw native function pointer for the pinned delegate |
Operators
Implicit(WrappedNativeCallback to IntPtr) | Converts a callback to an IntPtr suitable for passing to native code |