|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jogamp.gluegen.runtime.ProcAddressTable
public abstract class ProcAddressTable
Superclass for all generated ProcAddressTables. A ProcAddressTable is a cache of pointers to the dynamically-linkable C functions this autogenerated Java binding has exposed. Some libraries such as OpenGL, OpenAL and others define function pointer signatures rather than statically linkable entry points for the purposes of being able to query at run-time whether a particular extension is available. This table acts as a cache of these function pointers. Each function pointer is typically looked up at run-time by a platform-dependent mechanism such as dlsym(), wgl/glXGetProcAddress(), or alGetProcAddress(). If the field containing the function pointer is 0, the function is considered to be unavailable and can not be called.
FunctionAddressResolver
,
DynamicLookupHelper
Field Summary | |
---|---|
protected static boolean |
DEBUG
|
protected static String |
DEBUG_PREFIX
|
protected static int |
debugNum
|
Constructor Summary | |
---|---|
ProcAddressTable()
|
|
ProcAddressTable(FunctionAddressResolver resolver)
|
Method Summary | |
---|---|
long |
getAddressFor(String functionName)
This is a convenience method to query the native function handle by name. |
Set<String> |
getNullPointerFunctions()
Returns all functions pointing to null. |
void |
initEntry(String name,
DynamicLookupHelper lookup)
Initializes the mapping for a single function. |
boolean |
isFunctionAvailable(String functionName)
Returns true only if non null function pointer to this function exists. |
protected boolean |
isFunctionAvailableImpl(String functionName)
This is a convenience method to query the native function existence by name. |
void |
reset(DynamicLookupHelper lookup)
Resets the complete table. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static boolean DEBUG
protected static String DEBUG_PREFIX
protected static int debugNum
Constructor Detail |
---|
public ProcAddressTable()
public ProcAddressTable(FunctionAddressResolver resolver)
Method Detail |
---|
public void reset(DynamicLookupHelper lookup) throws SecurityException, RuntimeException
If a SecurityManager
is installed, user needs link permissions
for all libraries, i.e. for new RuntimePermission("loadLibrary.*");
!
SecurityException
- if user is not granted access for all libraries.
RuntimeException
public void initEntry(String name, DynamicLookupHelper lookup) throws SecurityException, IllegalArgumentException
If a SecurityManager
is installed, user needs link permissions
for all libraries, i.e. for new RuntimePermission("loadLibrary.*");
!
IllegalArgumentException
- if this function is not in this table.
SecurityException
- if user is not granted access for all libraries.public final boolean isFunctionAvailable(String functionName)
protected boolean isFunctionAvailableImpl(String functionName) throws IllegalArgumentException
It lets you avoid having to
manually compute the "PROCADDRESS_VAR_PREFIX
+ <functionName>"
member variable name and look it up via reflection.
IllegalArgumentException
- if this function is not in this table.public long getAddressFor(String functionName) throws SecurityException, IllegalArgumentException
It lets you avoid having to
manually compute the "PROCADDRESS_VAR_PREFIX
+ <functionName>"
member variable name and look it up via reflection.
If a SecurityManager
is installed, user needs link permissions
for all libraries, i.e. for new RuntimePermission("loadLibrary.*");
!
IllegalArgumentException
- if this function is not in this table.
SecurityException
- if user is not granted access for all libraries.public final Set<String> getNullPointerFunctions()
public final String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |