com.kenai.jaffl.provider.jffi
Class Provider

java.lang.Object
  extended by com.kenai.jaffl.FFIProvider
      extended by com.kenai.jaffl.provider.jffi.Provider

public class Provider
extends FFIProvider


Constructor Summary
Provider()
           
 
Method Summary
 int getLastError()
          Gets the last native error code.
 MemoryManager getMemoryManager()
          Gets the native memory manager for this provider.
 Type getType(NativeType type)
           
<T> T
loadLibrary(java.lang.Class<T> interfaceClass, java.util.Map<LibraryOption,?> libraryOptions, java.lang.String... libraryNames)
          Loads a native library and links the methods defined in interfaceClass to native methods in the library.
<T> T
loadLibrary(java.lang.String libraryName, java.lang.Class<T> interfaceClass, java.util.Map<LibraryOption,?> libraryOptions)
          Loads a native library and links the methods defined in interfaceClass to native methods in the library.
 void setLastError(int error)
          Sets the native error code.
 
Methods inherited from class com.kenai.jaffl.FFIProvider
getProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Provider

public Provider()
Method Detail

getMemoryManager

public MemoryManager getMemoryManager()
Description copied from class: FFIProvider
Gets the native memory manager for this provider.

Specified by:
getMemoryManager in class FFIProvider
Returns:
a MemoryManager

loadLibrary

public <T> T loadLibrary(java.lang.String libraryName,
                         java.lang.Class<T> interfaceClass,
                         java.util.Map<LibraryOption,?> libraryOptions)
Description copied from class: FFIProvider
Loads a native library and links the methods defined in interfaceClass to native methods in the library.

Specified by:
loadLibrary in class FFIProvider
Parameters:
libraryName - the name of the library to load
interfaceClass - the interface that describes the native library interface
libraryOptions - options
Returns:
an instance of interfaceclass that will call the native methods.

loadLibrary

public <T> T loadLibrary(java.lang.Class<T> interfaceClass,
                         java.util.Map<LibraryOption,?> libraryOptions,
                         java.lang.String... libraryNames)
Description copied from class: FFIProvider
Loads a native library and links the methods defined in interfaceClass to native methods in the library.

Specified by:
loadLibrary in class FFIProvider
Parameters:
interfaceClass - the interface that describes the native library interface
libraryOptions - options
libraryNames - the list of libraries to load
Returns:
an instance of interfaceclass that will call the native methods.

getLastError

public int getLastError()
Description copied from class: FFIProvider
Gets the last native error code.

This returns the errno value that was set at the time of the last native function call.

Specified by:
getLastError in class FFIProvider
Returns:
The errno value.

setLastError

public void setLastError(int error)
Description copied from class: FFIProvider
Sets the native error code.

Specified by:
setLastError in class FFIProvider
Parameters:
error - The value to set errno to.

getType

public Type getType(NativeType type)
Specified by:
getType in class FFIProvider