Package com.jogamp.gluegen.runtime
Class ProcAddressTable
java.lang.Object
com.jogamp.gluegen.runtime.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.
- Author:
- Kenneth Russel, Michael Bien, Sven Gothel
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static booleanprotected static Stringprotected static int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetAddressFor(String functionName) This is a convenience method to query the native function handle by name.Returns all functions pointing to null.voidinitEntry(String name, DynamicLookupHelper lookup) Initializes the mapping for a single function.final booleanisFunctionAvailable(String functionName) Returns true only if non null function pointer to this function exists.protected booleanisFunctionAvailableImpl(String functionName) This is a convenience method to query the native function existence by name.voidreset(DynamicLookupHelper lookup) Resets the complete table.final StringtoString()
-
Field Details
-
DEBUG
protected static boolean DEBUG -
DEBUG_PREFIX
-
debugNum
protected static int debugNum
-
-
Constructor Details
-
ProcAddressTable
public ProcAddressTable() -
ProcAddressTable
-
-
Method Details
-
reset
Resets the complete table.If a
SecurityManageris installed, user needs link permissions for all libraries, i.e. fornew RuntimePermission("loadLibrary.*");!- Throws:
SecurityException- if user is not granted access for all libraries.RuntimeException
-
initEntry
public void initEntry(String name, DynamicLookupHelper lookup) throws SecurityException, IllegalArgumentException Initializes the mapping for a single function.If a
SecurityManageris installed, user needs link permissions for all libraries, i.e. fornew RuntimePermission("loadLibrary.*");!- Throws:
IllegalArgumentException- if this function is not in this table.SecurityException- if user is not granted access for all libraries.
-
isFunctionAvailable
Returns true only if non null function pointer to this function exists. -
isFunctionAvailableImpl
This is a convenience method to query the native function existence by name.It lets you avoid having to manually compute the "
PROCADDRESS_VAR_PREFIX+ <functionName>" member variable name and look it up via reflection.- Throws:
IllegalArgumentException- if this function is not in this table.
-
getAddressFor
This is a convenience method to query the native function handle by name.It lets you avoid having to manually compute the "
PROCADDRESS_VAR_PREFIX+ <functionName>" member variable name and look it up via reflection.If a
SecurityManageris installed, user needs link permissions for all libraries, i.e. fornew RuntimePermission("loadLibrary.*");!- Throws:
IllegalArgumentException- if this function is not in this table.SecurityException- if user is not granted access for all libraries.
-
getNullPointerFunctions
Returns all functions pointing to null. -
toString
-