Top Description Inners Fields Constructors Methods
com.kenai.jffi

pack-priv final Class DirectClosureBuffer

extends Object
implements Buffer
Class Inheritance
All Implemented Interfaces
com.kenai.jffi.Closure.Buffer

Implementation of the Closure.Buffer interface to read/write parameter and return value data in native memory

Nested and Inner Type Summary

Modifier and TypeClass and Description
private abstract 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
private static class

Field Summary

Modifier and TypeField and Description
private final CallContext
private static final MemoryIO
private static final long
private final long
private final long
private static final DirectClosureBuffer.NativeWordIO

Constructor Summary

AccessConstructor and Description
public
DirectClosureBuffer(CallContext callContext, long retval, long parameters)

Method Summary

Modifier and TypeMethod and Description
public final long
getAddress(int
The parameter index
index
)

Implements com.kenai.jffi.Closure.Buffer.getAddress.

Gets the value of a native pointer parameter.
public final byte
getByte(int
The parameter index
index
)

Implements com.kenai.jffi.Closure.Buffer.getByte.

Gets the value of an 8 bit integer parameter.
public final double
getDouble(int
The parameter index
index
)

Implements com.kenai.jffi.Closure.Buffer.getDouble.

Gets the value of a 64 bit floating point parameter.
public final float
getFloat(int
The parameter index
index
)

Implements com.kenai.jffi.Closure.Buffer.getFloat.

Gets the value of a 32 bit floating point parameter.
public final int
getInt(int
The parameter index
index
)

Implements com.kenai.jffi.Closure.Buffer.getInt.

Gets the value of a 32 bit integer parameter.
public final long
getLong(int
The parameter index
index
)

Implements com.kenai.jffi.Closure.Buffer.getLong.

Gets the value of a 64 bit integer parameter.
public final short
getShort(int
The parameter index
index
)

Implements com.kenai.jffi.Closure.Buffer.getShort.

Gets the value of a 16 bit integer parameter.
public final long
getStruct(int
The parameter index
index
)

Implements com.kenai.jffi.Closure.Buffer.getStruct.

Gets the address of a struct parameter that is passed by value.
public final void
setAddressReturn(long
The native pointer value to return from the closure.
address
)

Implements com.kenai.jffi.Closure.Buffer.setAddressReturn.

Sets the closure return value to a native pointer value.
public final void
setByteReturn(byte
The 8 bit integer value to return from the closure.
value
)

Implements com.kenai.jffi.Closure.Buffer.setByteReturn.

Sets the closure return value to an 8 bit integer value.
public final void
setDoubleReturn(double
The 64 bit floating point value to return from the closure.
value
)

Implements com.kenai.jffi.Closure.Buffer.setDoubleReturn.

Sets the closure return value to a 64 bit floating point value.
public final void
setFloatReturn(float
The 32 bit floating point value to return from the closure.
value
)

Implements com.kenai.jffi.Closure.Buffer.setFloatReturn.

Sets the closure return value to a 32 bit floating point value.
public final void
setIntReturn(int
The 32 bit integer value to return from the closure.
value
)

Implements com.kenai.jffi.Closure.Buffer.setIntReturn.

Sets the closure return value to a 32 bit integer value.
public final void
setLongReturn(long
The 64 bit integer value to return from the closure.
value
)

Implements com.kenai.jffi.Closure.Buffer.setLongReturn.

Sets the closure return value to a 64 bit integer value.
public final void
setShortReturn(short
The 16 bit integer value to return from the closure.
value
)

Implements com.kenai.jffi.Closure.Buffer.setShortReturn.

Sets the closure return value to a 16 bit integer value.
public void
setStructReturn(long
The address of a native struct to return as a struct value from the closure.
value
)

Implements com.kenai.jffi.Closure.Buffer.setStructReturn.

Sets the closure return value to the contents of a struct
public void
setStructReturn(byte[]
Struct data packed into a byte array to return as a struct value from the closure.
data
,
int
the offset within the byte array to start copying data
offset
)

Implements com.kenai.jffi.Closure.Buffer.setStructReturn.

Sets the closure return value to the contents of a struct
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

callContextback to summary
private final CallContext callContext
IOback to summary
private static final MemoryIO IO
PARAM_SIZEback to summary
private static final long PARAM_SIZE
parametersback to summary
private final long parameters
retvalback to summary
private final long retval
WordIOback to summary
private static final DirectClosureBuffer.NativeWordIO WordIO

Constructor Detail

DirectClosureBufferback to summary
public DirectClosureBuffer(CallContext callContext, long retval, long parameters)

Method Detail

getAddressback to summary
public final long getAddress(int index)

Implements com.kenai.jffi.Closure.Buffer.getAddress.

Doc from com.kenai.jffi.Closure.Buffer.getAddress.

Gets the value of a native pointer parameter.

Parameters
index:int

The parameter index

Returns:long

A native memory address.

getByteback to summary
public final byte getByte(int index)

Implements com.kenai.jffi.Closure.Buffer.getByte.

Doc from com.kenai.jffi.Closure.Buffer.getByte.

Gets the value of an 8 bit integer parameter.

Parameters
index:int

The parameter index

Returns:byte

An 8 bit integer value.

getDoubleback to summary
public final double getDouble(int index)

Implements com.kenai.jffi.Closure.Buffer.getDouble.

Doc from com.kenai.jffi.Closure.Buffer.getDouble.

Gets the value of a 64 bit floating point parameter.

Parameters
index:int

The parameter index

Returns:double

A 64 bit floating point value.

getFloatback to summary
public final float getFloat(int index)

Implements com.kenai.jffi.Closure.Buffer.getFloat.

Doc from com.kenai.jffi.Closure.Buffer.getFloat.

Gets the value of a 32 bit floating point parameter.

Parameters
index:int

The parameter index

Returns:float

A 32 bit floating point value.

getIntback to summary
public final int getInt(int index)

Implements com.kenai.jffi.Closure.Buffer.getInt.

Doc from com.kenai.jffi.Closure.Buffer.getInt.

Gets the value of a 32 bit integer parameter.

Parameters
index:int

The parameter index

Returns:int

A 32 bit integer value.

getLongback to summary
public final long getLong(int index)

Implements com.kenai.jffi.Closure.Buffer.getLong.

Doc from com.kenai.jffi.Closure.Buffer.getLong.

Gets the value of a 64 bit integer parameter.

Parameters
index:int

The parameter index

Returns:long

A 64 bit integer value.

getShortback to summary
public final short getShort(int index)

Implements com.kenai.jffi.Closure.Buffer.getShort.

Doc from com.kenai.jffi.Closure.Buffer.getShort.

Gets the value of a 16 bit integer parameter.

Parameters
index:int

The parameter index

Returns:short

A 16 bit integer value.

getStructback to summary
public final long getStruct(int index)

Implements com.kenai.jffi.Closure.Buffer.getStruct.

Doc from com.kenai.jffi.Closure.Buffer.getStruct.

Gets the address of a struct parameter that is passed by value.

Parameters
index:int

The parameter index

Returns:long

A native memory address.

setAddressReturnback to summary
public final void setAddressReturn(long address)

Implements com.kenai.jffi.Closure.Buffer.setAddressReturn.

Doc from com.kenai.jffi.Closure.Buffer.setAddressReturn.

Sets the closure return value to a native pointer value.

Parameters
address:long

The native pointer value to return from the closure.

setByteReturnback to summary
public final void setByteReturn(byte value)

Implements com.kenai.jffi.Closure.Buffer.setByteReturn.

Doc from com.kenai.jffi.Closure.Buffer.setByteReturn.

Sets the closure return value to an 8 bit integer value.

Parameters
value:byte

The 8 bit integer value to return from the closure.

setDoubleReturnback to summary
public final void setDoubleReturn(double value)

Implements com.kenai.jffi.Closure.Buffer.setDoubleReturn.

Doc from com.kenai.jffi.Closure.Buffer.setDoubleReturn.

Sets the closure return value to a 64 bit floating point value.

Parameters
value:double

The 64 bit floating point value to return from the closure.

setFloatReturnback to summary
public final void setFloatReturn(float value)

Implements com.kenai.jffi.Closure.Buffer.setFloatReturn.

Doc from com.kenai.jffi.Closure.Buffer.setFloatReturn.

Sets the closure return value to a 32 bit floating point value.

Parameters
value:float

The 32 bit floating point value to return from the closure.

setIntReturnback to summary
public final void setIntReturn(int value)

Implements com.kenai.jffi.Closure.Buffer.setIntReturn.

Doc from com.kenai.jffi.Closure.Buffer.setIntReturn.

Sets the closure return value to a 32 bit integer value.

Parameters
value:int

The 32 bit integer value to return from the closure.

setLongReturnback to summary
public final void setLongReturn(long value)

Implements com.kenai.jffi.Closure.Buffer.setLongReturn.

Doc from com.kenai.jffi.Closure.Buffer.setLongReturn.

Sets the closure return value to a 64 bit integer value.

Parameters
value:long

The 64 bit integer value to return from the closure.

setShortReturnback to summary
public final void setShortReturn(short value)

Implements com.kenai.jffi.Closure.Buffer.setShortReturn.

Doc from com.kenai.jffi.Closure.Buffer.setShortReturn.

Sets the closure return value to a 16 bit integer value.

Parameters
value:short

The 16 bit integer value to return from the closure.

setStructReturnback to summary
public void setStructReturn(long value)

Implements com.kenai.jffi.Closure.Buffer.setStructReturn.

Doc from com.kenai.jffi.Closure.Buffer.setStructReturn.

Sets the closure return value to the contents of a struct

Parameters
value:long

The address of a native struct to return as a struct value from the closure.

setStructReturnback to summary
public void setStructReturn(byte[] data, int offset)

Implements com.kenai.jffi.Closure.Buffer.setStructReturn.

Doc from com.kenai.jffi.Closure.Buffer.setStructReturn.

Sets the closure return value to the contents of a struct

Parameters
data:byte[]

Struct data packed into a byte array to return as a struct value from the closure.

offset:int

the offset within the byte array to start copying data

com.kenai.jffi back to summary

private abstract Class DirectClosureBuffer.NativeWordIO

extends Object
Class Inheritance
Known Direct Subclasses
com.kenai.jffi.DirectClosureBuffer.NativeWordIO32, com.kenai.jffi.DirectClosureBuffer.NativeWordIO64

Reads annd writes data types that are smaller than the size of a native long, as a native long for compatibility with FFI.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv abstract int

Returns:

An integer
get
(long
The memory address to read the value from
address
)

Reads a native long argument from native memory.

public static final DirectClosureBuffer.NativeWordIO
pack-priv abstract void
put(long
The address to write the value at
address
,
int
The value to write.
value
)

Writes a native long argument to native memory.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NativeWordIOback to summary
private NativeWordIO()

Method Detail

getback to summary
pack-priv abstract int get(long address)

Reads a native long argument from native memory.

Parameters
address:long

The memory address to read the value from

Returns:int

An integer

getInstanceback to summary
public static final DirectClosureBuffer.NativeWordIO getInstance()
putback to summary
pack-priv abstract void put(long address, int value)

Writes a native long argument to native memory.

Parameters
address:long

The address to write the value at

value:int

The value to write.

com.kenai.jffi back to summary

private final Class DirectClosureBuffer.NativeWordIO32

extends NativeWordIO
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv static final DirectClosureBuffer.NativeWordIO
private static final MemoryIO

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv int
get(long
The memory address to read the value from
address
)

Implements abstract com.kenai.jffi.DirectClosureBuffer.NativeWordIO.get.

Reads a native long argument from native memory.
pack-priv void
put(long
The address to write the value at
address
,
int
The value to write.
value
)

Implements abstract com.kenai.jffi.DirectClosureBuffer.NativeWordIO.put.

Writes a native long argument to native memory.
Inherited from com.kenai.jffi.DirectClosureBuffer.NativeWordIO:
getInstance

Field Detail

INSTANCEback to summary
pack-priv static final DirectClosureBuffer.NativeWordIO INSTANCE
IOback to summary
private static final MemoryIO IO

Constructor Detail

NativeWordIO32back to summary
private NativeWordIO32()

Method Detail

getback to summary
pack-priv int get(long address)

Implements abstract com.kenai.jffi.DirectClosureBuffer.NativeWordIO.get.

Doc from com.kenai.jffi.DirectClosureBuffer.NativeWordIO.get.

Reads a native long argument from native memory.

Parameters
address:long

The memory address to read the value from

Returns:int

An integer

putback to summary
pack-priv void put(long address, int value)

Implements abstract com.kenai.jffi.DirectClosureBuffer.NativeWordIO.put.

Doc from com.kenai.jffi.DirectClosureBuffer.NativeWordIO.put.

Writes a native long argument to native memory.

Parameters
address:long

The address to write the value at

value:int

The value to write.

com.kenai.jffi back to summary

private final Class DirectClosureBuffer.NativeWordIO64

extends NativeWordIO
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv static final DirectClosureBuffer.NativeWordIO
private static final MemoryIO

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv int
get(long
The memory address to read the value from
address
)

Implements abstract com.kenai.jffi.DirectClosureBuffer.NativeWordIO.get.

Reads a native long argument from native memory.
pack-priv void
put(long
The address to write the value at
address
,
int
The value to write.
value
)

Implements abstract com.kenai.jffi.DirectClosureBuffer.NativeWordIO.put.

Writes a native long argument to native memory.
Inherited from com.kenai.jffi.DirectClosureBuffer.NativeWordIO:
getInstance

Field Detail

INSTANCEback to summary
pack-priv static final DirectClosureBuffer.NativeWordIO INSTANCE
IOback to summary
private static final MemoryIO IO

Constructor Detail

NativeWordIO64back to summary
private NativeWordIO64()

Method Detail

getback to summary
pack-priv int get(long address)

Implements abstract com.kenai.jffi.DirectClosureBuffer.NativeWordIO.get.

Doc from com.kenai.jffi.DirectClosureBuffer.NativeWordIO.get.

Reads a native long argument from native memory.

Parameters
address:long

The memory address to read the value from

Returns:int

An integer

putback to summary
pack-priv void put(long address, int value)

Implements abstract com.kenai.jffi.DirectClosureBuffer.NativeWordIO.put.

Doc from com.kenai.jffi.DirectClosureBuffer.NativeWordIO.put.

Writes a native long argument to native memory.

Parameters
address:long

The address to write the value at

value:int

The value to write.