public final class CallContext
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) long |
contextAddress
The native address of the context
|
(package private) int |
flags |
private Foreign |
foreign
A handle to the foreign interface to keep it alive as long as this object is alive
|
private int |
parameterCount
The number of parameters this function takes
|
(package private) long[] |
parameterTypeHandles |
(package private) Type[] |
parameterTypes
The parameter types of this function
|
private int |
rawParameterSize
The size of buffer required when packing parameters
|
(package private) Type |
returnType
The return type of this function
|
Constructor and Description |
---|
CallContext(Type returnType,
Type... parameterTypes)
Creates a new instance of Function with default calling convention.
|
CallContext(Type returnType,
Type[] parameterTypes,
CallingConvention convention)
Creates a new instance of Function.
|
CallContext(Type returnType,
Type[] parameterTypes,
CallingConvention convention,
boolean saveErrno) |
CallContext(Type returnType,
Type[] parameterTypes,
CallingConvention convention,
boolean saveErrno,
boolean faultProtect)
Creates a new instance of Function.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Deprecated.
|
boolean |
equals(java.lang.Object o) |
protected void |
finalize() |
(package private) long |
getAddress()
Gets the address of the function context.
|
static CallContext |
getCallContext(Type returnType,
Type[] parameterTypes,
CallingConvention convention,
boolean saveErrno)
Returns a
CallContext instance. |
static CallContext |
getCallContext(Type returnType,
Type[] parameterTypes,
CallingConvention convention,
boolean saveErrno,
boolean faultProtect) |
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.
|
int |
hashCode() |
final long contextAddress
private final int parameterCount
private final int rawParameterSize
final Type returnType
final Type[] parameterTypes
final long[] parameterTypeHandles
final int flags
private final Foreign foreign
public CallContext(Type returnType, Type... parameterTypes)
returnType
- The return type of the native function.parameterTypes
- The parameter types the function accepts.public CallContext(Type returnType, Type[] parameterTypes, CallingConvention convention)
returnType
- The return type of the native function.parameterTypes
- The parameter types the function accepts.convention
- The calling convention of the function.public CallContext(Type returnType, Type[] parameterTypes, CallingConvention convention, boolean saveErrno)
CallContext(Type returnType, Type[] parameterTypes, CallingConvention convention, boolean saveErrno, boolean faultProtect)
returnType
- The return type of the native function.parameterTypes
- The parameter types the function accepts.convention
- The calling convention of the function.saveErrno
- Whether the errno should be saved or notpublic static CallContext getCallContext(Type returnType, Type[] parameterTypes, CallingConvention convention, boolean saveErrno)
CallContext
instance. This may return a previously cached instance that matches
the signature requested, and should be used in preference to instantiating new instances.returnType
- The return type of the native function.parameterTypes
- The parameter types the function accepts.convention
- The calling convention of the function.saveErrno
- Indicates that the errno should be savedpublic static CallContext getCallContext(Type returnType, Type[] parameterTypes, CallingConvention convention, boolean saveErrno, boolean faultProtect)
public final int getParameterCount()
public final int getRawParameterSize()
final long getAddress()
public final Type getReturnType()
public final Type getParameterType(int index)
index
- The index of the parameter in the function signaturepublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
@Deprecated public final void dispose()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable