public abstract class FFIProvider
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
FFIProvider() |
Modifier and Type | Method and Description |
---|---|
abstract int |
getLastError()
Gets the last native error code.
|
abstract MemoryManager |
getMemoryManager()
Gets the native memory manager for this provider.
|
static FFIProvider |
getProvider()
Gets an instance of FFIProvider
|
abstract Type |
getType(NativeType type) |
abstract <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. |
abstract <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. |
abstract void |
setLastError(int error)
Sets the native error code.
|
public static final FFIProvider getProvider()
public abstract MemoryManager getMemoryManager()
MemoryManager
public abstract <T> T loadLibrary(java.lang.String libraryName, java.lang.Class<T> interfaceClass, java.util.Map<LibraryOption,?> libraryOptions)
interfaceClass
to native methods in the library.libraryName
- the name of the library to loadinterfaceClass
- the interface that describes the native library interfacelibraryOptions
- optionsinterfaceclass
that will call the native methods.public abstract <T> T loadLibrary(java.lang.Class<T> interfaceClass, java.util.Map<LibraryOption,?> libraryOptions, java.lang.String... libraryNames)
interfaceClass
to native methods in the library.interfaceClass
- the interface that describes the native library interfacelibraryOptions
- optionslibraryNames
- the list of libraries to loadinterfaceclass
that will call the native methods.public abstract int getLastError()
This returns the errno value that was set at the time of the last native function call.
public abstract void setLastError(int error)
error
- The value to set errno to.public abstract Type getType(NativeType type)