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