com.kenai.jffi
Interface Closure.Buffer

Enclosing interface:
Closure

public static interface Closure.Buffer

An interface to the native callback parameter buffer.


Method Summary
 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 address)
          Sets the closure return value to the contents of a struct
 

Method Detail

getByte

byte getByte(int index)
Gets the value of an 8 bit integer parameter.

Parameters:
index - The parameter index
Returns:
An 8 bit integer value.

getShort

short getShort(int index)
Gets the value of a 16 bit integer parameter.

Parameters:
index - The parameter index
Returns:
A 16 bit integer value.

getInt

int getInt(int index)
Gets the value of a 32 bit integer parameter.

Parameters:
index - The parameter index
Returns:
A 32 bit integer value.

getLong

long getLong(int index)
Gets the value of a 64 bit integer parameter.

Parameters:
index - The parameter index
Returns:
A 64 bit integer value.

getFloat

float getFloat(int index)
Gets the value of a 32 bit floating point parameter.

Parameters:
index - The parameter index
Returns:
A 32 bit floating point value.

getDouble

double getDouble(int index)
Gets the value of a 64 bit floating point parameter.

Parameters:
index - The parameter index
Returns:
A 64 bit floating point value.

getAddress

long getAddress(int index)
Gets the value of a native pointer parameter.

Parameters:
index - The parameter index
Returns:
A native memory address.

getStruct

long getStruct(int index)
Gets the address of a struct parameter that is passed by value.

Parameters:
index - The parameter index
Returns:
A native memory address.

setByteReturn

void setByteReturn(byte value)
Sets the closure return value to an 8 bit integer value.

Parameters:
value - The 8 bit integer value to return from the closure.

setShortReturn

void setShortReturn(short value)
Sets the closure return value to a 16 bit integer value.

Parameters:
value - The 16 bit integer value to return from the closure.

setIntReturn

void setIntReturn(int value)
Sets the closure return value to a 32 bit integer value.

Parameters:
value - The 32 bit integer value to return from the closure.

setLongReturn

void setLongReturn(long value)
Sets the closure return value to a 64 bit integer value.

Parameters:
value - The 64 bit integer value to return from the closure.

setFloatReturn

void setFloatReturn(float value)
Sets the closure return value to a 32 bit floating point value.

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

setDoubleReturn

void setDoubleReturn(double value)
Sets the closure return value to a 64 bit floating point value.

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

setAddressReturn

void setAddressReturn(long address)
Sets the closure return value to a native pointer value.

Parameters:
address - The native pointer value to return from the closure.

setStructReturn

void setStructReturn(long address)
Sets the closure return value to the contents of a struct

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

setStructReturn

void setStructReturn(byte[] data,
                     int offset)
Sets the closure return value to the contents of a struct

Parameters:
data - 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