Package org.lwjgl.system
Class Callback
- java.lang.Object
-
- org.lwjgl.system.Callback
-
- All Implemented Interfaces:
java.lang.AutoCloseable,NativeResource,Pointer
- Direct Known Subclasses:
CGEventTapCallBack,EnumerationMutationHandler,WindowProc
public abstract class Callback extends java.lang.Object implements Pointer, NativeResource
Base class for dynamically created native functions that call into Java code.Callback instances use native resources and must be explicitly freed when no longer used by calling the
free()method.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
-
Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String__stdcall(java.lang.String signature)longaddress()Returns the raw pointer address as alongvalue.booleanequals(java.lang.Object o)voidfree()Frees any native resources held by this object.static voidfree(long functionPointer)Frees any resources held by the specified function pointer.static <T extends CallbackI>
Tget(long functionPointer)Converts the specified function pointer to theCallbackIinstance associated with it.static <T extends CallbackI>
TgetSafe(long functionPointer)inthashCode()java.lang.StringtoString()-
Methods inherited from interface org.lwjgl.system.NativeResource
close
-
-
-
-
Method Detail
-
address
public long address()
Description copied from interface:PointerReturns the raw pointer address as alongvalue.
-
free
public void free()
Description copied from interface:NativeResourceFrees any native resources held by this object.- Specified by:
freein interfaceNativeResource
-
__stdcall
public static java.lang.String __stdcall(java.lang.String signature)
-
get
public static <T extends CallbackI> T get(long functionPointer)
Converts the specified function pointer to theCallbackIinstance associated with it.- Type Parameters:
T- theCallbackIinstance type- Parameters:
functionPointer- a function pointer- Returns:
- the
CallbackIinstance
-
getSafe
@Nullable public static <T extends CallbackI> T getSafe(long functionPointer)
-
free
public static void free(long functionPointer)
Frees any resources held by the specified function pointer.- Parameters:
functionPointer- the function pointer
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-