Package ch.bailu.gtk.lib.handler
Class CallbackHandler
java.lang.Object
ch.bailu.gtk.lib.handler.CallbackHandler
Handler to callback resource.
Stores java reference to callback in a hash map
Provides function to free reference to callback
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
dump
(PrintStream out) Dump resources (contents of internal map as text) to streamGet instance this callback ist registered to Only call this if this callbacks will never called againName of method this callback was registered withvoid
register
(com.sun.jna.Callback callback) For internal use (gets called after callback was passed to a C function)toString()
void
Unregister this callback Removes java reference to callback Only call this if this callbacks will never called againstatic void
unregister
(Pointer instance) Unregister all callbacks of this instance Removes java reference to callback Only call this if this callbacks will never called againstatic void
unregister
(Pointer instance, String methodName) void
unregister
(String methodName) Unregister this callback if its methodName equals methodName Removes java reference to callback Only call this if this callbacks will never called again
-
Constructor Details
-
CallbackHandler
-
-
Method Details
-
register
public void register(com.sun.jna.Callback callback) For internal use (gets called after callback was passed to a C function)- Parameters:
callback
- (lambda)
-
unregister
public void unregister()Unregister this callback Removes java reference to callback Only call this if this callbacks will never called again -
unregister
Unregister all callbacks of this instance Removes java reference to callback Only call this if this callbacks will never called again- Parameters:
instance
-
-
unregister
Unregister this callback if its methodName equals methodName Removes java reference to callback Only call this if this callbacks will never called again- Parameters:
methodName
- string identifier (name)
-
unregister
-
getInstance
Get instance this callback ist registered to Only call this if this callbacks will never called again- Returns:
- instance this callback belongs to
-
getMethodName
Name of method this callback was registered with- Returns:
- methodName
-
dump
Dump resources (contents of internal map as text) to stream- Parameters:
out
- stream
-
toString
-