final class DirectClosureBuffer extends java.lang.Object implements Closure.Buffer
Closure.Buffer interface to read/write
parameter and return value data in native memory| Modifier and Type | Class and Description |
|---|---|
private static class |
DirectClosureBuffer.NativeWordIO
Reads annd writes data types that are smaller than the size of a native
long, as a native long for compatibility with FFI.
|
private static class |
DirectClosureBuffer.NativeWordIO32 |
private static class |
DirectClosureBuffer.NativeWordIO64 |
| Modifier and Type | Field and Description |
|---|---|
private CallContext |
callContext |
private static MemoryIO |
IO |
private static long |
PARAM_SIZE |
private long |
parameters |
private long |
retval |
private static DirectClosureBuffer.NativeWordIO |
WordIO |
| Constructor and Description |
|---|
DirectClosureBuffer(CallContext callContext,
long retval,
long parameters) |
| Modifier and Type | Method and Description |
|---|---|
long |
getAddress(int index)
Gets the value of a native pointer parameter.
|
byte |
getByte(int index)
Gets the value of an 8 bit integer parameter.
|
double |
getDouble(int index)
Gets the value of a 64 bit floating point parameter.
|
float |
getFloat(int index)
Gets the value of a 32 bit floating point parameter.
|
int |
getInt(int index)
Gets the value of a 32 bit integer parameter.
|
long |
getLong(int index)
Gets the value of a 64 bit integer parameter.
|
short |
getShort(int index)
Gets the value of a 16 bit integer parameter.
|
long |
getStruct(int index)
Gets the address of a struct parameter that is passed by value.
|
void |
setAddressReturn(long address)
Sets the closure return value to a native pointer value.
|
void |
setByteReturn(byte value)
Sets the closure return value to an 8 bit integer value.
|
void |
setDoubleReturn(double value)
Sets the closure return value to a 64 bit floating point value.
|
void |
setFloatReturn(float value)
Sets the closure return value to a 32 bit floating point value.
|
void |
setIntReturn(int value)
Sets the closure return value to a 32 bit integer value.
|
void |
setLongReturn(long value)
Sets the closure return value to a 64 bit integer value.
|
void |
setShortReturn(short value)
Sets the closure return value to a 16 bit integer value.
|
void |
setStructReturn(byte[] data,
int offset)
Sets the closure return value to the contents of a struct
|
void |
setStructReturn(long value)
Sets the closure return value to the contents of a struct
|
private static final MemoryIO IO
private static final DirectClosureBuffer.NativeWordIO WordIO
private static final long PARAM_SIZE
private final long retval
private final long parameters
private final CallContext callContext
public DirectClosureBuffer(CallContext callContext, long retval, long parameters)
public final byte getByte(int index)
Closure.BuffergetByte in interface Closure.Bufferindex - The parameter indexpublic final short getShort(int index)
Closure.BuffergetShort in interface Closure.Bufferindex - The parameter indexpublic final int getInt(int index)
Closure.BuffergetInt in interface Closure.Bufferindex - The parameter indexpublic final long getLong(int index)
Closure.BuffergetLong in interface Closure.Bufferindex - The parameter indexpublic final float getFloat(int index)
Closure.BuffergetFloat in interface Closure.Bufferindex - The parameter indexpublic final double getDouble(int index)
Closure.BuffergetDouble in interface Closure.Bufferindex - The parameter indexpublic final long getAddress(int index)
Closure.BuffergetAddress in interface Closure.Bufferindex - The parameter indexpublic final long getStruct(int index)
Closure.BuffergetStruct in interface Closure.Bufferindex - The parameter indexpublic final void setByteReturn(byte value)
Closure.BuffersetByteReturn in interface Closure.Buffervalue - The 8 bit integer value to return from the closure.public final void setShortReturn(short value)
Closure.BuffersetShortReturn in interface Closure.Buffervalue - The 16 bit integer value to return from the closure.public final void setIntReturn(int value)
Closure.BuffersetIntReturn in interface Closure.Buffervalue - The 32 bit integer value to return from the closure.public final void setLongReturn(long value)
Closure.BuffersetLongReturn in interface Closure.Buffervalue - The 64 bit integer value to return from the closure.public final void setFloatReturn(float value)
Closure.BuffersetFloatReturn in interface Closure.Buffervalue - The 32 bit floating point value to return from the closure.public final void setDoubleReturn(double value)
Closure.BuffersetDoubleReturn in interface Closure.Buffervalue - The 64 bit floating point value to return from the closure.public final void setAddressReturn(long address)
Closure.BuffersetAddressReturn in interface Closure.Bufferaddress - The native pointer value to return from the closure.public void setStructReturn(long value)
Closure.BuffersetStructReturn in interface Closure.Buffervalue - The address of a native struct to return as a struct value from the closure.public void setStructReturn(byte[] data,
int offset)
Closure.BuffersetStructReturn in interface Closure.Bufferdata - Struct data packed into a byte array to return as a struct value from the closure.offset - the offset within the byte array to start copying data