|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jstatcom.engine.CPtr com.jstatcom.engine.CFunc
public final class CFunc
An abstraction for a C function pointer. An instance of CFunc
represents a pointer to some C function. callXXX
methods
provide means to call the function; select a xxx
variant based
on the return type of the C function.
Beware that the copyIn
, copyOut
,
setXXX
, and getXXX
methods inherited from the
parent will indirect machine code.
CPtr
Field Summary |
---|
Fields inherited from class com.jstatcom.engine.CPtr |
---|
NULL, SIZE |
Constructor Summary | |
---|---|
CFunc(java.lang.String lib,
java.lang.String fname)
Create a new CFunc that is linked with a C function that
follows the standard "C" calling convention. |
|
CFunc(java.lang.String lib,
java.lang.String fname,
java.lang.String conv)
Create a new CFunc that is linked with a C function that
follows a given calling convention. |
Method Summary | |
---|---|
CPtr |
callCPtr(java.lang.Object[] args)
Call the C function being represented by this object. |
double |
callDouble(java.lang.Object[] args)
Call the C function being represented by this object. |
float |
callFloat(java.lang.Object[] args)
Call the C function being represented by this object. |
int |
callInt(java.lang.Object[] args)
Call the C function being represented by this object. |
void |
callVoid(java.lang.Object[] args)
Call the C function being represented by this object. |
Methods inherited from class com.jstatcom.engine.CPtr |
---|
copyIn, copyIn, copyIn, copyIn, copyIn, copyIn, copyIn, copyOut, copyOut, copyOut, copyOut, copyOut, copyOut, copyOut, equals, getByte, getCPtr, getDouble, getFloat, getInt, getLong, getShort, getString, hashCode, setByte, setCPtr, setDouble, setFloat, setInt, setLong, setShort, setString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CFunc(java.lang.String lib, java.lang.String fname, java.lang.String conv)
CFunc
that is linked with a C function that
follows a given calling convention.
The allocated instance represents a pointer to the named C function from the named library, called with the named calling convention.
lib
- library in which to find the C functionfname
- name of the C function to be linked withconv
- calling convention used by the C functionpublic CFunc(java.lang.String lib, java.lang.String fname)
CFunc
that is linked with a C function that
follows the standard "C" calling convention.
The allocated instance represents a pointer to the named C function from the named library, called with the standard "C" calling convention.
lib
- library in which to find the C functionfname
- name of the C function to be linked withMethod Detail |
---|
public int callInt(java.lang.Object[] args)
args
- arguments to pass to the C function
int
value returned by the underlying
C functionpublic void callVoid(java.lang.Object[] args)
args
- arguments to pass to the C functionpublic float callFloat(java.lang.Object[] args)
args
- arguments to pass to the C function
float
value returned by the underlying
C functionpublic double callDouble(java.lang.Object[] args)
args
- arguments to pass to the C function
double
value returned by the underlying
C functionpublic CPtr callCPtr(java.lang.Object[] args)
args
- arguments to pass to the C function
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |