Servertec
Jenie
1.0.1 09/04/2005

stec.jenie
Class Function

java.lang.Object
  extended by stec.jenie.Function

public class Function
extends java.lang.Object

Represents a reference to a native function.

Since:
1.0.0 12/05/2004

Field Summary
static int CDECL
          The caller cleans the stack.
static int STDCALL
          The callee cleans the stack.
 
Constructor Summary
Function(Dll dll, java.lang.String name)
          Constructs a new reference to a native function.
Function(Dll dll, java.lang.String name, int calling_convention)
          Constructs a new reference to a native function.
Function(long pointer)
          Constructs a new reference to a native function.
 
Method Summary
 void call()
          Calls this native function.
 void call(NativeParameter[] parameters)
          Calls this native function with the specified parameters.
 void call(NativeParameter[] parameters, NativeParameter return_code)
          Calls this native function with the specified parameters and return code.
 void call(NativeParameter parameter, NativeParameter return_code)
          Calls this native function with the specified parameter and return code.
 void call(NativeParameter parameter1, NativeParameter parameter2, NativeParameter return_code)
          Calls this native function with the specified parameters and return code.
 void call(NativeParameter parameter1, NativeParameter parameter2, NativeParameter parameter3, NativeParameter return_code)
          Calls this native function with the specified parameters and return code.
 boolean equals(java.lang.Object object)
          Returns whether this native function equals the specified native function.
 int getCallingConvention()
          Returns the calling convention.
 long getNativeAddress()
          Returns the native address of this function.
 int hashCode()
          Returns the hash code of this native function.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STDCALL

public static final int STDCALL
The callee cleans the stack.

This is the default calling convention for Win32 API functions.

See Also:
Constant Field Values

CDECL

public static final int CDECL
The caller cleans the stack.

This is the default calling convention for C functions.

This enables calling native functions with variable number or parameters.

See Also:
Constant Field Values
Constructor Detail

Function

public Function(Dll dll,
                java.lang.String name)
         throws NativeException
Constructs a new reference to a native function.

Parameters:
dll - the dll to use.
name - the name of the function.
Throws:
NativeException - if any exception occurs.

Function

public Function(long pointer)
Constructs a new reference to a native function.

Parameters:
pointer - the pointer to the native function.

Function

public Function(Dll dll,
                java.lang.String name,
                int calling_convention)
         throws NativeException,
                java.lang.IllegalArgumentException
Constructs a new reference to a native function.

Parameters:
dll - the dll to use.
name - the name of the function.
calling_convention - the calling convention. -1 for the default calling convention.
Throws:
NativeException - if any exception occurs.
java.lang.IllegalArgumentException
Method Detail

call

public void call(NativeParameter[] parameters,
                 NativeParameter return_code)
          throws NativeException
Calls this native function with the specified parameters and return code.

Parameters:
parameters - any parameters to use. null for none.
return_code - any return code to use. null for none.
Throws:
NativeException - if any exception occurs.

call

public void call(NativeParameter[] parameters)
          throws NativeException
Calls this native function with the specified parameters.

Parameters:
parameters - any parameters to use. null for none.
Throws:
NativeException - if any exception occurs.

call

public void call(NativeParameter parameter,
                 NativeParameter return_code)
          throws NativeException
Calls this native function with the specified parameter and return code.

Parameters:
parameter - the first parameter to use. null for none.
return_code - the return code. null for none.
Throws:
NativeException - if any exception occurs.

call

public void call(NativeParameter parameter1,
                 NativeParameter parameter2,
                 NativeParameter return_code)
          throws NativeException
Calls this native function with the specified parameters and return code.

Parameters:
parameter1 - the first parameter to use. null for none.
parameter2 - the second parameter to use. null for none.
return_code - the return code. null for none.
Throws:
NativeException - if any exception occurs.

call

public void call(NativeParameter parameter1,
                 NativeParameter parameter2,
                 NativeParameter parameter3,
                 NativeParameter return_code)
          throws NativeException
Calls this native function with the specified parameters and return code.

Parameters:
parameter1 - the first parameter to use. null for none.
parameter2 - the second parameter to use. null for none.
parameter3 - the second parameter to use. null for none.
return_code - the return code. null for none.
Throws:
NativeException - if any exception occurs.

call

public void call()
          throws NativeException
Calls this native function.

Throws:
NativeException - if any exception occurs.

getNativeAddress

public long getNativeAddress()
Returns the native address of this function.

Returns:
the native address of this function.

equals

public boolean equals(java.lang.Object object)
Returns whether this native function equals the specified native function.

Overrides:
equals in class java.lang.Object
Parameters:
object - the native function to compare against.
Returns:
whether this native function equals the specified native function.

hashCode

public int hashCode()
Returns the hash code of this native function.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code of this native function.

getCallingConvention

public int getCallingConvention()
Returns the calling convention.

Returns:
the calling convention.

Servertec
Jenie
1.0.1 09/04/2005

Copyright © 2004-2005 Servertec. All rights reserved.