public class TClrDelegates
extends java.lang.Object
static
utility methods for converting managed (.Net) delegate types to
unmanaged (Java) callback types and vice-versa.Constructor and Description |
---|
TClrDelegates() |
Modifier and Type | Method and Description |
---|---|
static com.sun.jna.Callback |
getCallback(java.lang.Class<?> type,
com.sun.jna.Pointer p)
Gets a callback from the function pointer using the specified type.
|
static TClrDelegate |
getDelegate(java.lang.Class<?> type,
com.sun.jna.Pointer p)
Gets a TClrDelegate callback from the function pointer using the specified type.
|
static DotNetNativeTypes.ClrObject |
getDelegateForFunctionPointer(com.sun.jna.Pointer pointer,
DotNetNativeTypes.ClrType type)
Converts a java function pointer to a .Net delegate which will be stored as ClrObject.
|
static DotNetNativeTypes.ClrObject |
getDelegateForFunctionPointer(com.sun.jna.Pointer pointer,
java.lang.String typeName)
Converts a java function pointer to a .Net delegate which will be stored as ClrObject.
|
static DotNetNativeTypes.ClrObject |
getDelegateForFunctionPointer(TClrDelegate delegate,
DotNetNativeTypes.ClrType type)
Converts a java function pointer which inherits from TClrDelegate to a .Net delegate which will be stored as ClrObject.
|
static DotNetNativeTypes.ClrObject |
getDelegateForFunctionPointer(TClrDelegate delegate,
java.lang.String typeName)
Converts a java function pointer which inherits from TClrDelegate to a .Net delegate which will be stored as ClrObject.
|
static com.sun.jna.Pointer |
getFunctionPointer(com.sun.jna.Callback cb)
Gets a function pointer from the callback specified.
|
static com.sun.jna.Pointer |
getFunctionPointer(TClrDelegate delegate)
Gets a function pointer from the delegate object.
|
static <T extends TClrDelegate> |
getFunctionPointerForDelegate(DotNetNativeTypes.ClrObject delegateObject,
java.lang.Class<T> delegateClass)
Converts a CLR delegate object into a TClrDelegate callback that is callable from a java code.
|
static <T extends TClrDelegate> |
getFunctionPointerForDelegate(IClrObject delegateObject,
java.lang.Class<T> delegateClass)
Converts a CLR delegate into a TClrDelegate callback that is callable from java code.
|
static <T extends TClrDelegate> |
getFunctionPointerForDelegate(java.lang.Object delegateObject,
java.lang.Class<T> delegateClass)
Converts a CLR delegate object into a TClrDelegate callback that is callable from java code.
|
public static final DotNetNativeTypes.ClrObject getDelegateForFunctionPointer(com.sun.jna.Pointer pointer, DotNetNativeTypes.ClrType type) throws EClrError
pointer
- The java function pointer to be converted.type
- The CLR type of the delegate to be returned.EClrError
public static final DotNetNativeTypes.ClrObject getDelegateForFunctionPointer(com.sun.jna.Pointer pointer, java.lang.String typeName) throws EClrError
pointer
- The java function pointer to be converted.typeName
- The CLR type name of the delegate to be returned.EClrError
public static final DotNetNativeTypes.ClrObject getDelegateForFunctionPointer(TClrDelegate delegate, DotNetNativeTypes.ClrType type) throws EClrError
delegate
- The java function pointer delegate to be converted.type
- The CLR type name of the delegate to be returned.EClrError
public static final DotNetNativeTypes.ClrObject getDelegateForFunctionPointer(TClrDelegate delegate, java.lang.String typeName) throws EClrError
delegate
- The java function pointer delegate to be converted.typeName
- The CLR type name of the delegate to be returned.EClrError
public static com.sun.jna.Callback getCallback(java.lang.Class<?> type, com.sun.jna.Pointer p)
type
- The type of the Callback to be returned.p
- The function pointer to be converted to Callback.public static TClrDelegate getDelegate(java.lang.Class<?> type, com.sun.jna.Pointer p)
type
- The type of the TClrDelegate callback to be returned.p
- The function pointer to be converted to TClrDelegate Callbackpublic static com.sun.jna.Pointer getFunctionPointer(com.sun.jna.Callback cb)
cb
- The Callback to be converted to a function pointerpublic static com.sun.jna.Pointer getFunctionPointer(TClrDelegate delegate)
delegate
- The delegate object to be converted to the function pointer.public static <T extends TClrDelegate> T getFunctionPointerForDelegate(DotNetNativeTypes.ClrObject delegateObject, java.lang.Class<T> delegateClass) throws EClrError
T
- Any TClrDelegate typedelegateObject
- The delegate object to be passed to Java code.delegateClass
- The type of the function pointer to be returned.EClrError
public static <T extends TClrDelegate> T getFunctionPointerForDelegate(java.lang.Object delegateObject, java.lang.Class<T> delegateClass) throws EClrError
T
- Any TClrDelegate typedelegateObject
- The delegate object to be passed to Java code.delegateClass
- The type of the function pointer to be returned.EClrError
public static <T extends TClrDelegate> T getFunctionPointerForDelegate(IClrObject delegateObject, java.lang.Class<T> delegateClass) throws EClrError
T
- Any TClrDelegate typedelegateObject
- The Clr delegate to be passed to Java code.delegateClass
- The type of the function pointer to be returned.EClrError