public final class Function
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private CallContext |
callContext |
(package private) long |
contextAddress |
(package private) long |
functionAddress
The address of the function
|
Constructor and Description |
---|
Function(long address,
CallContext callContext)
Creates a new instance of Function with default calling convention.
|
Function(long address,
Type returnType,
Type... paramTypes)
Creates a new instance of Function with default calling convention.
|
Function(long address,
Type returnType,
Type[] paramTypes,
CallingConvention convention)
Creates a new instance of Function.
|
Function(long address,
Type returnType,
Type[] paramTypes,
CallingConvention convention,
boolean saveErrno)
Creates a new instance of Function.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Deprecated.
|
CallContext |
getCallContext() |
(package private) long |
getContextAddress()
Gets the address of the function context.
|
long |
getFunctionAddress()
Gets the address of the function.
|
int |
getParameterCount()
Gets the number of parameters the native function accepts.
|
Type |
getParameterType(int index)
Gets the type of a parameter.
|
int |
getRawParameterSize()
Gets the number of bytes required to pack all the parameters this function
accepts, into a region of memory.
|
Type |
getReturnType()
Gets the native return type of this function.
|
private final CallContext callContext
final long functionAddress
final long contextAddress
public Function(long address, Type returnType, Type... paramTypes)
address
- The native address of the function to invoke.returnType
- The return type of the native function.paramTypes
- The parameter types the function accepts.public Function(long address, CallContext callContext)
address
- The native address of the function to invoke.public Function(long address, Type returnType, Type[] paramTypes, CallingConvention convention)
address
- The native address of the function to invoke.returnType
- The return type of the native function.paramTypes
- The parameter types the function accepts.convention
- The calling convention of the function.public Function(long address, Type returnType, Type[] paramTypes, CallingConvention convention, boolean saveErrno)
address
- The native address of the function to invoke.returnType
- The return type of the native function.paramTypes
- The parameter types the function accepts.convention
- The calling convention of the function.saveErrno
- Whether the errno should be saved or notpublic final int getParameterCount()
public final int getRawParameterSize()
public final CallContext getCallContext()
final long getContextAddress()
public final long getFunctionAddress()
public final Type getReturnType()
public final Type getParameterType(int index)
index
- The index of the parameter in the function signature@Deprecated public final void dispose()