public class JnaNativeInterface extends java.lang.Object implements INativeInterface
INativeInterface
implemented using JNA, a LGPL licensed Java
native interface abstraction.
In our point of view, JNA has the power of deploying all what we wanted to have, but is ill designed in some key hot spots - so we worked around and built on top of our own interfaces.
Constructor and Description |
---|
JnaNativeInterface() |
Modifier and Type | Method and Description |
---|---|
void |
addSearchPath(java.lang.String path)
Add a directory to the search path.
|
INativeHandle |
allocate(int size)
Allocate c memory and return the respective
INativeHandle . |
INativeCallback |
createCallback(ICallback callback) |
INativeFunction |
createFunction(long address)
Create an
INativeFunction from a function pointer. |
INativeHandle |
createHandle(long address)
Create a void
INativeHandle to a memory address. |
INativeLibrary |
createLibrary(java.lang.String name)
Load a new
INativeLibrary . |
protected java.util.List<java.lang.String> |
getSearchPaths() |
int |
longSize()
The platform long size.
|
int |
pointerSize()
The platform pointer size.
|
int |
wideCharSize()
The platform wide char size.
|
public void addSearchPath(java.lang.String path)
INativeInterface
addSearchPath
in interface INativeInterface
path
- The path to be added;public INativeHandle allocate(int size)
INativeInterface
INativeHandle
.allocate
in interface INativeInterface
size
- The size in bytes.INativeHandle
public INativeCallback createCallback(ICallback callback)
createCallback
in interface INativeInterface
public INativeFunction createFunction(long address)
INativeInterface
INativeFunction
from a function pointer.
There is no special handling for the 0 address!
createFunction
in interface INativeInterface
address
- The function pointer.public INativeHandle createHandle(long address)
INativeInterface
INativeHandle
to a memory address.
There is no special handling for the 0 address!
createHandle
in interface INativeInterface
address
- The memory address.public INativeLibrary createLibrary(java.lang.String name)
INativeInterface
INativeLibrary
.createLibrary
in interface INativeInterface
name
- The name of the library to load.INativeLibrary
protected java.util.List<java.lang.String> getSearchPaths()
public int longSize()
INativeInterface
longSize
in interface INativeInterface
public int pointerSize()
INativeInterface
pointerSize
in interface INativeInterface
public int wideCharSize()
INativeInterface
wideCharSize
in interface INativeInterface