|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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
|
static String |
PROCADDRESS_VAR_PREFIX
|
Constructor Summary | |
---|---|
ProcAddressTable()
|
|
ProcAddressTable(FunctionAddressResolver resolver)
|
Method Summary | |
---|---|
protected Field |
fieldForFunction(String name)
|
protected String |
fieldToFunctionName(String addressFieldName)
|
long |
getAddressFor(String functionName)
This is a convenience method to get (by name) the native function pointer for a given function. |
protected static PrintStream |
getDebugOutStream()
|
Set |
getNullPointerFunctions()
Returns all functions pointing to null. |
void |
initEntry(String name,
DynamicLookupHelper lookup)
Initializes the mapping for a single function. |
protected boolean |
isAddressField(String fieldName)
|
boolean |
isFunctionAvailable(String functionName)
Returns true only if non null function pointer to this function exists. |
void |
reset(DynamicLookupHelper lookup)
Resets the complete table. |
protected void |
setEntry(Field addressField,
String funcName,
DynamicLookupHelper lookup)
|
Map |
toMap()
Returns this table as map with the function name as key and the address as value. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String PROCADDRESS_VAR_PREFIX
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 RuntimeException
RuntimeException
public void initEntry(String name, DynamicLookupHelper lookup)
IllegalArgumentException
- if this function is not in this table.protected void setEntry(Field addressField, String funcName, DynamicLookupHelper lookup)
protected String fieldToFunctionName(String addressFieldName)
protected Field fieldForFunction(String name)
protected boolean isAddressField(String fieldName)
protected static PrintStream getDebugOutStream()
public Map toMap()
public boolean isFunctionAvailable(String functionName)
public long getAddressFor(String functionName)
PROCADDRESS_VAR_PREFIX
+ <functionName>"
member variable name and look it up via reflection.
IllegalArgumentException
- if this function is not in this table.public Set getNullPointerFunctions()
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |