|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.smardec.j2native.Function
Function
class is Java representation of the native function. This class is used to
call native function. In dependence of native method calling convention, stack will be arranged in
different ways. So, be sure you exactly know calling convention of native method.
Library
,
Argument
Field Summary | |
static byte |
CDECL_CALLING_CONVENTION
CDECL calling convention |
static byte |
DEFAULT_CALLING_CONVENTION
System default calling convention |
static byte |
PASCAL_CALLING_CONVENTION
PASCAL calling convention |
static byte |
STDCALL_CALLING_CONVENTION
STDCALL calling convention |
Constructor Summary | |
Function(long address,
byte callingConvention)
Creates new Function . |
|
Function(long address,
byte callingConvention,
java.lang.String functionName)
Creates new Function . |
Method Summary | |
static void |
call(java.lang.String libraryName,
java.lang.String functionName,
Argument returnValue)
Loads Library , specified by it's name, locates within it specified function, passes
arguments to this function and then invokes it. |
static void |
call(java.lang.String libraryName,
java.lang.String functionName,
Argument returnValue,
Argument argument)
Loads Library , specified by it's name, locates within it specified function, passes
arguments to this function and then invokes it. |
static void |
call(java.lang.String libraryName,
java.lang.String functionName,
Argument returnValue,
Argument[] arguments)
Loads Library , specified by it's name, locates within it specified function, passes
arguments to this function and then invokes it. |
static void |
call(java.lang.String libraryName,
java.lang.String functionName,
Argument returnValue,
Argument argument1,
Argument argument2)
Loads Library , specified by it's name, locates within it specified function, passes
arguments to this function and then invokes it. |
static void |
call(java.lang.String libraryName,
java.lang.String functionName,
Argument returnValue,
Argument argument1,
Argument argument2,
Argument argument3)
Loads Library , specified by it's name, locates within it specified function, passes
arguments to this function and then invokes it. |
static void |
call(java.lang.String libraryName,
java.lang.String functionName,
Argument returnValue,
Argument argument1,
Argument argument2,
Argument argument3,
Argument argument4)
Loads Library , specified by it's name, locates within it specified function, passes
arguments to this function and then invokes it. |
byte |
getCallingConvention()
Returns function calling convention. |
java.lang.String |
getName()
Returns name of the function. |
void |
invoke(Argument returnValue)
Invokes native function, that associate with this Function instance. |
void |
invoke(Argument returnValue,
Argument argument)
Invokes native function, that associate with this Function instance. |
void |
invoke(Argument returnValue,
Argument[] arguments)
Invokes native function, that associate with this Function instance. |
void |
invoke(Argument returnValue,
Argument argument1,
Argument argument2)
Invokes native function, that associate with this Function instance. |
void |
invoke(Argument returnValue,
Argument argument1,
Argument argument2,
Argument argument3)
Invokes native function, that associate with this Function instance. |
void |
invoke(Argument returnValue,
Argument argument1,
Argument argument2,
Argument argument3,
Argument argument4)
Invokes native function, that associate with this Function instance. |
void |
setCallingConvention(byte callingConvention)
Sets function calling convention. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte CDECL_CALLING_CONVENTION
public static final byte STDCALL_CALLING_CONVENTION
public static final byte PASCAL_CALLING_CONVENTION
public static final byte DEFAULT_CALLING_CONVENTION
Constructor Detail |
public Function(long address, byte callingConvention)
Function
.
address
- entry point for native functioncallingConvention
- calling convention of the functionpublic Function(long address, byte callingConvention, java.lang.String functionName)
Function
.
address
- entry point for native functioncallingConvention
- calling convention of the functionfunctionName
- custom function nameMethod Detail |
public byte getCallingConvention()
public void setCallingConvention(byte callingConvention)
callingConvention
- calling conventionpublic java.lang.String getName()
public void invoke(Argument returnValue, Argument[] arguments) throws FunctionExecutionException
Function
instance. You have to provide
exactly type of the return value parameter. If native function have no return value, null is a valid.
returnValue
- native return value representation in Javaarguments
- array of Argument
parameters, that should be passed to native function
FunctionExecutionException
- if something goes wrongpublic final void invoke(Argument returnValue) throws FunctionExecutionException
Function
instance. You have to provide
exactly type of the return value parameter. If native function have no return value, null is a valid.
This method is used for no parameters native functions only.
returnValue
- native return value representation in Java
FunctionExecutionException
- if something goes wrongpublic final void invoke(Argument returnValue, Argument argument) throws FunctionExecutionException
Function
instance. You have to provide
exactly type of the return value parameter. If native function have no return value, null is a valid.
This method is used for one parameter native functions only.
returnValue
- native return value representation in Javaargument
- Argument
parameter, that should be passed to native function
FunctionExecutionException
- if something goes wrongpublic final void invoke(Argument returnValue, Argument argument1, Argument argument2) throws FunctionExecutionException
Function
instance. You have to provide
exactly type of the return value parameter. If native function have no return value, null is a valid.
This method is used for two parameters native functions only.
returnValue
- native return value representation in Javaargument1
- first Argument
parameter, that should be passed to native functionargument2
- second Argument
parameter, that should be passed to native function
FunctionExecutionException
- if something goes wrongpublic final void invoke(Argument returnValue, Argument argument1, Argument argument2, Argument argument3) throws FunctionExecutionException
Function
instance. You have to provide
exactly type of the return value parameter. If native function have no return value, null is a valid.
This method is used for three parameters native functions only.
returnValue
- native return value representation in Javaargument1
- first Argument
parameter, that should be passed to native functionargument2
- second Argument
parameter, that should be passed to native functionargument3
- third Argument
parameter, that should be passed to native function
FunctionExecutionException
- if something goes wrongpublic final void invoke(Argument returnValue, Argument argument1, Argument argument2, Argument argument3, Argument argument4) throws FunctionExecutionException
Function
instance. You have to provide
exactly type of the return value parameter. If native function have no return value, null is a valid.
This method is used for four parameters native functions only.
returnValue
- native return value representation in Javaargument1
- first Argument
parameter, that should be passed to native functionargument2
- second Argument
parameter, that should be passed to native functionargument3
- third Argument
parameter, that should be passed to native functionargument4
- forth Argument
parameter, that should be passed to native function
FunctionExecutionException
- if something goes wrongpublic static void call(java.lang.String libraryName, java.lang.String functionName, Argument returnValue, Argument[] arguments) throws FunctionExecutionException
Library
, specified by it's name, locates within it specified function, passes
arguments to this function and then invokes it. You have to provide
exactly type of the return value parameter. If native function have no return value, null is a valid.
libraryName
- name of the Library
, from which function will be loadedfunctionName
- name of the functionreturnValue
- native return value representation in Javaarguments
- array of Argument
parameters, that should be passed to native function
FunctionExecutionException
- if something goes wrongpublic static final void call(java.lang.String libraryName, java.lang.String functionName, Argument returnValue) throws FunctionExecutionException
Library
, specified by it's name, locates within it specified function, passes
arguments to this function and then invokes it. You have to provide
exactly type of the return value parameter. If native function have no return value, null is a valid.
This method is used for no parameters native functions only.
libraryName
- name of the Library
, from which function will be loadedfunctionName
- name of the functionreturnValue
- native return value representation in Java
FunctionExecutionException
- if something goes wrongpublic static final void call(java.lang.String libraryName, java.lang.String functionName, Argument returnValue, Argument argument) throws FunctionExecutionException
Library
, specified by it's name, locates within it specified function, passes
arguments to this function and then invokes it. You have to provide
exactly type of the return value parameter. If native function have no return value, null is a valid.
This method is used for one parameter native functions only.
libraryName
- name of the Library
, from which function will be loadedfunctionName
- name of the functionreturnValue
- native return value representation in Javaargument
- Argument
parameter, that should be passed to native function
FunctionExecutionException
- if something goes wrongpublic static final void call(java.lang.String libraryName, java.lang.String functionName, Argument returnValue, Argument argument1, Argument argument2) throws FunctionExecutionException
Library
, specified by it's name, locates within it specified function, passes
arguments to this function and then invokes it. You have to provide
exactly type of the return value parameter. If native function have no return value, null is a valid.
This method is used for two parameters native functions only.
libraryName
- name of the Library
, from which function will be loadedfunctionName
- name of the functionreturnValue
- native return value representation in Javaargument1
- first Argument
parameter, that should be passed to native functionargument2
- second Argument
parameter, that should be passed to native function
FunctionExecutionException
- if something goes wrongpublic static final void call(java.lang.String libraryName, java.lang.String functionName, Argument returnValue, Argument argument1, Argument argument2, Argument argument3) throws FunctionExecutionException
Library
, specified by it's name, locates within it specified function, passes
arguments to this function and then invokes it. You have to provide
exactly type of the return value parameter. If native function have no return value, null is a valid.
This method is used for three parameters native functions only.
libraryName
- name of the Library
, from which function will be loadedfunctionName
- name of the functionreturnValue
- native return value representation in Javaargument1
- first Argument
parameter, that should be passed to native functionargument2
- second Argument
parameter, that should be passed to native functionargument3
- third Argument
parameter, that should be passed to native function
FunctionExecutionException
- if something goes wrongpublic static final void call(java.lang.String libraryName, java.lang.String functionName, Argument returnValue, Argument argument1, Argument argument2, Argument argument3, Argument argument4) throws FunctionExecutionException
Library
, specified by it's name, locates within it specified function, passes
arguments to this function and then invokes it. You have to provide
exactly type of the return value parameter. If native function have no return value, null is a valid.
This method is used for four parameters native functions only.
libraryName
- name of the Library
, from which function will be loadedfunctionName
- name of the functionreturnValue
- native return value representation in Javaargument1
- first Argument
parameter, that should be passed to native functionargument2
- second Argument
parameter, that should be passed to native functionargument3
- third Argument
parameter, that should be passed to native functionargument4
- forth Argument
parameter, that should be passed to native function
FunctionExecutionException
- if something goes wrong
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |