aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-07-01 18:57:37 +0200
committerSven Gothel <[email protected]>2023-07-01 18:57:37 +0200
commit8766fcfdce4dd864fe6764b063a0f9a4b17327c1 (patch)
tree4fb5a2441b0a3fb9f3d12c6456f316b42b579cac /doc
parent6200b9122a90ef8c2af8b9205b4b1c90b1aa5074 (diff)
GlueGen JavaCallback: Only produce default 'Key' class if keys are used, expose 'Key' to public and use it. Expose release*() and get*Keys() methods
Further we use a dedicated lock Object used in the Java implementation. TODO: Native static callback dispatch code shall - (also) acquire the lock - handle case where the data has been released already to render this solution thread-safe and data-race free
Diffstat (limited to 'doc')
-rw-r--r--doc/GlueGen_Mapping.html154
-rw-r--r--doc/GlueGen_Mapping.md124
2 files changed, 178 insertions, 100 deletions
diff --git a/doc/GlueGen_Mapping.html b/doc/GlueGen_Mapping.html
index e173c01..9520f34 100644
--- a/doc/GlueGen_Mapping.html
+++ b/doc/GlueGen_Mapping.html
@@ -1994,6 +1994,10 @@ Definition</h4>
<p>If no keys are defined via <code>JavaCallbackKey</code>, or manually
injected using a custom <code>SetCallback-KeyClass</code>, see below,
the <code>CallbackFunction</code> has global scope.</p>
+<p>In case keys are defined via <code>JavaCallbackKey</code> and no
+manually injected custom <code>SetCallback-KeyClass</code> used, a
+public <code>SetCallback-KeyClass</code> is being generated covering the
+defined keys.</p>
<p>Keys allow to limit the scope, i.e. map multiple
<code>CallbackFunction</code> to the different keys.</p>
<p>Key arguments must match in <code>SetCallbackFunction</code> to
@@ -2008,18 +2012,62 @@ callback scope, i.e. the callback and all resources will be mapped to
this key. The optional <code>SetCallback-KeyClass</code> may override
this semantic.</li>
</ul>
-<p>Beside generating the actual function mapping of the API, additional
-query methods are generated, passing the keys as its paramters</p>
-<ul>
-<li><code>boolean is&lt;SetCallbackFunctionName&gt;Mapped((key-arg)*)</code>
-queries whether <code>SetCallbackFunctionName</code> is mapped.</li>
-<li><code>ALBUFFERCALLBACKTYPESOFT get&lt;SetCallbackFunctionName&gt;((key-arg)*)</code>
+<h4
+id="javacallback-generated-interfaces-classes-and-methods"><em>JavaCallback</em>
+Generated Interfaces, Classes and Methods</h4>
+<p>The public <code>CallbackFunction</code> interface is generated.</p>
+<p>The default public <code>SetCallback-KeyClass</code> is generated if
+keys are used and no custom class is specified, see above.</p>
+<p>The public toolkit API <code>SetCallbackFunction</code> method is
+being generated.</p>
+<p>Additional public <em>maintenance</em> methods are generated. In case
+keys are being used, they expect <code>SetCallback-KeyClass</code> as an
+argument, otherwise they expect no argument for global scope.</p>
+<p>In case keys are defined and hence <code>SetCallback-KeyClass</code>
+used, the additional <em>maintenance</em> methods are:</p>
+<ul>
+<li><em>Set&lt;<code>SetCallback-KeyClass</code>&gt;
+get<code>SetCallbackFunctionName</code>Keys()</em></li>
+<li><em>boolean
+is<code>SetCallbackFunctionName</code>Mapped(<code>SetCallback-KeyClass</code>)</em>
+queries whether <code>SetCallbackFunctionName</code> is mapped to
+key.</li>
+<li><em><code>CallbackFunction</code>
+get<code>SetCallbackFunctionName</code>(<code>SetCallback-KeyClass</code>)</em>
returns the mapped <code>CallbackFunction</code>, null if not
mapped</li>
-<li><code>Object get&lt;SetCallbackFunctionName&gt;UserParam((key-arg)*)</code>
+<li><em>Object
+get<code>SetCallbackFunctionName</code>UserParam(<code>SetCallback-KeyClass</code>)</em>
+returns the mapped <code>userParam</code> object, null if not
+mapped</li>
+<li><em>void
+release<code>SetCallbackFunctionName</code>(<code>SetCallback-KeyClass</code>)</em>
+releases the mapped <code>CallbackFunction</code> data set associated
+via <code>SetCallbackFunctionName</code>.</li>
+<li><em>int releaseAll<code>SetCallbackFunctionName</code>()</em>
+releases complete mapped <code>CallbackFunction</code> data set
+associated via <code>SetCallbackFunctionName</code>.</li>
+</ul>
+<p>In no keys are defined and hence global scope used, the additional
+<em>maintenance</em> methods are:</p>
+<ul>
+<li><em>boolean is<code>SetCallbackFunctionName</code>Mapped()</em>
+queries whether <code>SetCallbackFunctionName</code> is mapped.</li>
+<li><em><code>CallbackFunction</code>
+get<code>SetCallbackFunctionName</code>()</em> returns the mapped
+<code>CallbackFunction</code>, null if not mapped</li>
+<li><em>Object get<code>SetCallbackFunctionName</code>UserParam()</em>
returns the mapped <code>userParam</code> object, null if not
mapped</li>
+<li><em>void release<code>SetCallbackFunctionName</code>()</em> releases
+the mapped <code>CallbackFunction</code> data set associated via
+<code>SetCallbackFunctionName</code>.</li>
</ul>
+<p>Note that the <em>release<code>SetCallbackFunctionName</code>(*)</em>
+and <em>releaseAll<code>SetCallbackFunctionName</code>()</em> methods
+are not the <em>proper toolkit API way</em> to remove the callback, try
+to use original <code>SetCallbackFunctionName</code> API method instead
+using a <code>null</code> <code>CallbackFunction</code> reference.</p>
<h4 id="custom-setcallback-keyclass">Custom
<code>SetCallback-KeyClass</code></h4>
<p>The <code>SetCallback-KeyClass</code> is the optional user-written
@@ -2094,10 +2142,11 @@ ArgumentIsString InjectMessageCallback01 1
#
# This callback has no keys defines, rendering it of global scope!
#
-# Explicit queries are generated, passing the keys as paramters
+# Explicit maintenance methods are generated, passing the keys as paramters
# - `boolean isMessageCallback01Mapped()` queries whether `MessageCallback0` is mapped globally
# - `T2_CallbackFunc01 getMessageCallback01()` returns the global T2_CallbackFunc01, null if not mapped
# - `Object getMessageCallback01UserParam()` returns the global `usrParam` object, null if not mapped
+# - `void releaseMessageCallback01()` releases callback data skipping toolkit API. Favor passing `null` callback ref to `MessageCallback01(..)`
JavaCallbackDef MessageCallback01 T2_CallbackFunc01 2</code></pre>
<p>Note that <a
href="#libraryonload-librarybasename-for-jni_onload-"><code>LibraryOnLoad Bindingtest2</code></a>
@@ -2121,34 +2170,20 @@ thread to the <code>JavaVM*</code> generating a new
/** Entry point (through function pointer) to C language function: &lt;br&gt; &lt;code&gt;void MessageCallback01(T2_CallbackFunc01 cbFunc, void * usrParam)&lt;/code&gt;&lt;br&gt; */
public void MessageCallback01(T2_CallbackFunc01 cbFunc, Object usrParam);
+ /** Returns if callback is mapped for &lt;br&gt; &lt;code&gt; public void MessageCallback01(T2_CallbackFunc01 cbFunc, Object usrParam)&lt;/code&gt; **/
public boolean isMessageCallback01Mapped();
+
+ /** Returns T2_CallbackFunc01 callback for &lt;br&gt; &lt;code&gt; public void MessageCallback01(T2_CallbackFunc01 cbFunc, Object usrParam)&lt;/code&gt; **/
public T2_CallbackFunc01 getMessageCallback01();
+
+ /** Returns user-param for &lt;br&gt; &lt;code&gt; public void MessageCallback01(T2_CallbackFunc01 cbFunc, Object usrParam)&lt;/code&gt; **/
public Object getMessageCallback01UserParam();
+ /** Releases callback data skipping toolkit API. Favor passing `null` callback ref to &lt;br&gt; &lt;code&gt; public void MessageCallback01(T2_CallbackFunc01 cbFunc, Object usrParam)&lt;/code&gt; **/
+ public void releaseMessageCallback01();
+
/** Entry point (through function pointer) to C language function: &lt;br&gt; &lt;code&gt;void InjectMessageCallback01(size_t id, const char * msg)&lt;/code&gt;&lt;br&gt; */
public void InjectMessageCallback01(long id, String msg);</code></pre>
-<p>Implementation utilizes the default <code>SetCallback-KeyClass</code>
-implementation for
-<code>void MessageCallback01(T2_CallbackFunc01 cbFunc, Object usrParam)</code>,
-which is key-less and hence minimalistic.</p>
-<pre><code> private static class MessageCallback01Key {
- MessageCallback01Key() {
- }
- @Override
- public boolean equals(final Object o) {
- if( this == o ) {
- return true;
- }
- if( !(o instanceof MessageCallback01Key) ) {
- return false;
- }
- return true;
- }
- @Override
- public int hashCode() {
- return 0;
- }
- }</code></pre>
<h3 id="javacallback-example-2a-default-keyclass">JavaCallback Example
2a (Default <em>KeyClass</em>)</h3>
<p>This examples is derived from OpenAL's
@@ -2173,9 +2208,12 @@ buffer.</p>
# The `buffer` key allows setting one callback per buffer-name, compatible with the `AL_SOFT_callback_buffer` spec.
#
# Explicit queries are generated, passing the keys as paramters
- # - `boolean isAlBufferCallback0Mapped(int buffer)` queries whether `alBufferCallback0` is mapped to `buffer`.
- # - `ALBUFFERCALLBACKTYPESOFT getAlBufferCallback0(int buffer)` returns the `buffer` mapped ALEVENTPROCSOFT, null if not mapped
- # - `Object getAlBufferCallback0UserParam(int buffer)` returns the `buffer` mapped `userptr` object, null if not mapped
+ # - `Set&lt;AlBufferCallback0Key&gt; getAlBufferCallback0Keys()` returns set of Key { int buffer }
+ # - `boolean isAlBufferCallback0Mapped(AlBufferCallback0Key)` queries whether `alBufferCallback0` is mapped to `buffer`.
+ # - `ALBUFFERCALLBACKTYPESOFT getAlBufferCallback0(AlBufferCallback0Key)` returns the `buffer` mapped ALEVENTPROCSOFT, null if not mapped
+ # - `Object getAlBufferCallback0UserParam(AlBufferCallback0Key)` returns the `buffer` mapped `userptr` object, null if not mapped
+ # - `void releaseAllAlBufferCallback0()` releases all callback data mapped via Key { int buffer } skipping toolkit API. Favor passing `null` callback ref to `alBufferCallback0(..)`
+ # - `void releaseAlBufferCallback0(AlBufferCallback0Key)` releases callback data mapped to Key { int buffer } skipping toolkit API. Favor passing `null` callback ref to `alBufferCallback0(..)`
JavaCallbackDef alBufferCallback0 ALBUFFERCALLBACKTYPESOFT 1
JavaCallbackKey alBufferCallback0 0</code></pre>
<p>leading to the following interface</p>
@@ -2186,23 +2224,11 @@ buffer.</p>
}
...
-
- /** Entry point (through function pointer) to C language function: &lt;br&gt; &lt;code&gt;void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, void * userptr)&lt;/code&gt;&lt;br&gt; */
- public void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr);
-
- public boolean isAlBufferCallback0Mapped(int buffer);
- public ALBUFFERCALLBACKTYPESOFT getAlBufferCallback0(int buffer);
- public Object getAlBufferCallback0UserParam(int buffer);
-
- /** Entry point (through function pointer) to C language function: &lt;br&gt; &lt;code&gt;void alEventCallbackInject(int eventType, int object, int param, const char * msg)&lt;/code&gt;&lt;br&gt; */
- public void alEventCallbackInject(int eventType, int object, int param, String msg); </code></pre>
-<p>Implementation utilizes the default <code>SetCallback-KeyClass</code>
-implementation for
-<code>void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr)</code>,
-which uses one key, i.e. <code>buffer</code>.</p>
-<pre><code> private static class AlBufferCallback0Key {
- private final int buffer;
- AlBufferCallback0Key(int buffer) {
+
+ /** Key { int buffer } for &lt;br&gt; &lt;code&gt; public void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr)&lt;/code&gt; **/
+ public static class AlBufferCallback0Key {
+ public final int buffer;
+ public AlBufferCallback0Key(int buffer) {
this.buffer = buffer;
}
@Override
@@ -2222,7 +2248,33 @@ which uses one key, i.e. <code>buffer</code>.</p>
int hash = buffer;
return hash;
}
- }</code></pre>
+ }
+
+ ...
+
+ /** Entry point (through function pointer) to C language function: &lt;br&gt; &lt;code&gt;void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, void * userptr)&lt;/code&gt;&lt;br&gt; */
+ public void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr);
+
+ /** Returns set of Key { int buffer } for &lt;br&gt; &lt;code&gt; public void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr)&lt;/code&gt; **/
+ public Set&lt;AlBufferCallback0Key&gt; getAlBufferCallback0Keys();
+
+ /** Returns whether callback Key { int buffer } is mapped for &lt;br&gt; &lt;code&gt; public void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr)&lt;/code&gt; **/
+ public boolean isAlBufferCallback0Mapped(AlBufferCallback0Key key);
+
+ /** Returns ALBUFFERCALLBACKTYPESOFT callback mapped to Key { int buffer } for &lt;br&gt; &lt;code&gt; public void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr)&lt;/code&gt; **/
+ public ALBUFFERCALLBACKTYPESOFT getAlBufferCallback0(AlBufferCallback0Key key);
+
+ /** Returns user-param mapped to Key { int buffer } for &lt;br&gt; &lt;code&gt; public void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr)&lt;/code&gt; **/
+ public Object getAlBufferCallback0UserParam(AlBufferCallback0Key key);
+
+ /** Releases all callback data mapped via Key { int buffer } skipping toolkit API. Favor passing `null` callback ref to &lt;br&gt; &lt;code&gt; public void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr)&lt;/code&gt; **/
+ public int releaseAllAlBufferCallback0();
+
+ /** Releases callback data mapped to Key { int buffer } skipping toolkit API. Favor passing `null` callback ref to &lt;br&gt; &lt;code&gt; public void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr)&lt;/code&gt; **/
+ public void releaseAlBufferCallback0(AlBufferCallback0Key key);
+
+ /** Entry point (through function pointer) to C language function: &lt;br&gt; &lt;code&gt;void alEventCallbackInject(int eventType, int object, int param, const char * msg)&lt;/code&gt;&lt;br&gt; */
+ public void alEventCallbackInject(int eventType, int object, int param, String msg); </code></pre>
<h3 id="javacallback-example-2b-custom-keyclass">JavaCallback Example 2b
(Custom <em>KeyClass</em>)</h3>
<p>Same as example 2a, but implementing a custom
diff --git a/doc/GlueGen_Mapping.md b/doc/GlueGen_Mapping.md
index 9a169d7..f43f7a6 100644
--- a/doc/GlueGen_Mapping.md
+++ b/doc/GlueGen_Mapping.md
@@ -800,6 +800,9 @@ If mapping the `CallbackFunction` to keys, the user must specify the same key ar
If no keys are defined via `JavaCallbackKey`, or manually injected using a custom `SetCallback-KeyClass`, see below,
the `CallbackFunction` has global scope.
+In case keys are defined via `JavaCallbackKey` and no manually injected custom `SetCallback-KeyClass` used,
+a public `SetCallback-KeyClass` is being generated covering the defined keys.
+
Keys allow to limit the scope, i.e. map multiple `CallbackFunction` to the different keys.
Key arguments must match in `SetCallbackFunction` to remove a previously set `CallbackFunction`.
@@ -808,11 +811,32 @@ Key arguments must match in `SetCallbackFunction` to remove a previously set `Ca
- `SetCallbackFunction`: `SetCallbackFunction` name of the native toolkit API responsible to set the callback
- `SetCallback-ParamIdx`: List of parameter indices of the `SetCallbackFunction`, denoting the key(s) limiting the callback scope, i.e. the callback and all resources will be mapped to this key. The optional `SetCallback-KeyClass` may override this semantic.
-Beside generating the actual function mapping of the API, additional query methods are generated, passing the keys as its paramters
-- `boolean is<SetCallbackFunctionName>Mapped((key-arg)*)` queries whether `SetCallbackFunctionName` is mapped.
-- `ALBUFFERCALLBACKTYPESOFT get<SetCallbackFunctionName>((key-arg)*)` returns the mapped `CallbackFunction`, null if not mapped
-- `Object get<SetCallbackFunctionName>UserParam((key-arg)*)` returns the mapped `userParam` object, null if not mapped
+#### *JavaCallback* Generated Interfaces, Classes and Methods
+
+The public `CallbackFunction` interface is generated.
+
+The default public `SetCallback-KeyClass` is generated if keys are used and no custom class is specified, see above.
+
+The public toolkit API `SetCallbackFunction` method is being generated.
+
+Additional public *maintenance* methods are generated. In case keys are being used, they expect `SetCallback-KeyClass` as an argument, otherwise they expect no argument for global scope.
+
+In case keys are defined and hence `SetCallback-KeyClass` used, the additional *maintenance* methods are:
+- *Set<`SetCallback-KeyClass`> get`SetCallbackFunctionName`Keys()*
+- *boolean is`SetCallbackFunctionName`Mapped(`SetCallback-KeyClass`)* queries whether `SetCallbackFunctionName` is mapped to key.
+- *`CallbackFunction` get`SetCallbackFunctionName`(`SetCallback-KeyClass`)* returns the mapped `CallbackFunction`, null if not mapped
+- *Object get`SetCallbackFunctionName`UserParam(`SetCallback-KeyClass`)* returns the mapped `userParam` object, null if not mapped
+- *void release`SetCallbackFunctionName`(`SetCallback-KeyClass`)* releases the mapped `CallbackFunction` data set associated via `SetCallbackFunctionName`.
+- *int releaseAll`SetCallbackFunctionName`()* releases complete mapped `CallbackFunction` data set associated via `SetCallbackFunctionName`.
+
+In no keys are defined and hence global scope used, the additional *maintenance* methods are:
+- *boolean is`SetCallbackFunctionName`Mapped()* queries whether `SetCallbackFunctionName` is mapped.
+- *`CallbackFunction` get`SetCallbackFunctionName`()* returns the mapped `CallbackFunction`, null if not mapped
+- *Object get`SetCallbackFunctionName`UserParam()* returns the mapped `userParam` object, null if not mapped
+- *void release`SetCallbackFunctionName`()* releases the mapped `CallbackFunction` data set associated via `SetCallbackFunctionName`.
+Note that the *release`SetCallbackFunctionName`(\*)* and *releaseAll`SetCallbackFunctionName`()* methods are not the *proper toolkit API way* to remove the callback,
+try to use original `SetCallbackFunctionName` API method instead using a `null` `CallbackFunction` reference.
#### Custom `SetCallback-KeyClass`
@@ -872,10 +896,11 @@ ArgumentIsString InjectMessageCallback01 1
#
# This callback has no keys defines, rendering it of global scope!
#
-# Explicit queries are generated, passing the keys as paramters
+# Explicit maintenance methods are generated, passing the keys as paramters
# - `boolean isMessageCallback01Mapped()` queries whether `MessageCallback0` is mapped globally
# - `T2_CallbackFunc01 getMessageCallback01()` returns the global T2_CallbackFunc01, null if not mapped
# - `Object getMessageCallback01UserParam()` returns the global `usrParam` object, null if not mapped
+# - `void releaseMessageCallback01()` releases callback data skipping toolkit API. Favor passing `null` callback ref to `MessageCallback01(..)`
JavaCallbackDef MessageCallback01 T2_CallbackFunc01 2
```
@@ -898,37 +923,22 @@ public interface Bindingtest2 {
/** Entry point (through function pointer) to C language function: <br> <code>void MessageCallback01(T2_CallbackFunc01 cbFunc, void * usrParam)</code><br> */
public void MessageCallback01(T2_CallbackFunc01 cbFunc, Object usrParam);
+ /** Returns if callback is mapped for <br> <code> public void MessageCallback01(T2_CallbackFunc01 cbFunc, Object usrParam)</code> **/
public boolean isMessageCallback01Mapped();
+
+ /** Returns T2_CallbackFunc01 callback for <br> <code> public void MessageCallback01(T2_CallbackFunc01 cbFunc, Object usrParam)</code> **/
public T2_CallbackFunc01 getMessageCallback01();
+
+ /** Returns user-param for <br> <code> public void MessageCallback01(T2_CallbackFunc01 cbFunc, Object usrParam)</code> **/
public Object getMessageCallback01UserParam();
+ /** Releases callback data skipping toolkit API. Favor passing `null` callback ref to <br> <code> public void MessageCallback01(T2_CallbackFunc01 cbFunc, Object usrParam)</code> **/
+ public void releaseMessageCallback01();
+
/** Entry point (through function pointer) to C language function: <br> <code>void InjectMessageCallback01(size_t id, const char * msg)</code><br> */
public void InjectMessageCallback01(long id, String msg);
```
-Implementation utilizes the default `SetCallback-KeyClass` implementation for `void MessageCallback01(T2_CallbackFunc01 cbFunc, Object usrParam)`,
-which is key-less and hence minimalistic.
-```
- private static class MessageCallback01Key {
- MessageCallback01Key() {
- }
- @Override
- public boolean equals(final Object o) {
- if( this == o ) {
- return true;
- }
- if( !(o instanceof MessageCallback01Key) ) {
- return false;
- }
- return true;
- }
- @Override
- public int hashCode() {
- return 0;
- }
- }
-```
-
### JavaCallback Example 2a (Default *KeyClass*)
This examples is derived from OpenAL's `AL_SOFT_callback_buffer` extension.
@@ -956,9 +966,12 @@ and the following GlueGen configuration
# The `buffer` key allows setting one callback per buffer-name, compatible with the `AL_SOFT_callback_buffer` spec.
#
# Explicit queries are generated, passing the keys as paramters
- # - `boolean isAlBufferCallback0Mapped(int buffer)` queries whether `alBufferCallback0` is mapped to `buffer`.
- # - `ALBUFFERCALLBACKTYPESOFT getAlBufferCallback0(int buffer)` returns the `buffer` mapped ALEVENTPROCSOFT, null if not mapped
- # - `Object getAlBufferCallback0UserParam(int buffer)` returns the `buffer` mapped `userptr` object, null if not mapped
+ # - `Set<AlBufferCallback0Key> getAlBufferCallback0Keys()` returns set of Key { int buffer }
+ # - `boolean isAlBufferCallback0Mapped(AlBufferCallback0Key)` queries whether `alBufferCallback0` is mapped to `buffer`.
+ # - `ALBUFFERCALLBACKTYPESOFT getAlBufferCallback0(AlBufferCallback0Key)` returns the `buffer` mapped ALEVENTPROCSOFT, null if not mapped
+ # - `Object getAlBufferCallback0UserParam(AlBufferCallback0Key)` returns the `buffer` mapped `userptr` object, null if not mapped
+ # - `void releaseAllAlBufferCallback0()` releases all callback data mapped via Key { int buffer } skipping toolkit API. Favor passing `null` callback ref to `alBufferCallback0(..)`
+ # - `void releaseAlBufferCallback0(AlBufferCallback0Key)` releases callback data mapped to Key { int buffer } skipping toolkit API. Favor passing `null` callback ref to `alBufferCallback0(..)`
JavaCallbackDef alBufferCallback0 ALBUFFERCALLBACKTYPESOFT 1
JavaCallbackKey alBufferCallback0 0
```
@@ -972,24 +985,11 @@ leading to the following interface
}
...
-
- /** Entry point (through function pointer) to C language function: <br> <code>void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, void * userptr)</code><br> */
- public void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr);
-
- public boolean isAlBufferCallback0Mapped(int buffer);
- public ALBUFFERCALLBACKTYPESOFT getAlBufferCallback0(int buffer);
- public Object getAlBufferCallback0UserParam(int buffer);
-
- /** Entry point (through function pointer) to C language function: <br> <code>void alEventCallbackInject(int eventType, int object, int param, const char * msg)</code><br> */
- public void alEventCallbackInject(int eventType, int object, int param, String msg);
-```
-
-Implementation utilizes the default `SetCallback-KeyClass` implementation for `void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr)`,
-which uses one key, i.e. `buffer`.
-```
- private static class AlBufferCallback0Key {
- private final int buffer;
- AlBufferCallback0Key(int buffer) {
+
+ /** Key { int buffer } for <br> <code> public void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr)</code> **/
+ public static class AlBufferCallback0Key {
+ public final int buffer;
+ public AlBufferCallback0Key(int buffer) {
this.buffer = buffer;
}
@Override
@@ -1010,6 +1010,32 @@ which uses one key, i.e. `buffer`.
return hash;
}
}
+
+ ...
+
+ /** Entry point (through function pointer) to C language function: <br> <code>void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, void * userptr)</code><br> */
+ public void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr);
+
+ /** Returns set of Key { int buffer } for <br> <code> public void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr)</code> **/
+ public Set<AlBufferCallback0Key> getAlBufferCallback0Keys();
+
+ /** Returns whether callback Key { int buffer } is mapped for <br> <code> public void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr)</code> **/
+ public boolean isAlBufferCallback0Mapped(AlBufferCallback0Key key);
+
+ /** Returns ALBUFFERCALLBACKTYPESOFT callback mapped to Key { int buffer } for <br> <code> public void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr)</code> **/
+ public ALBUFFERCALLBACKTYPESOFT getAlBufferCallback0(AlBufferCallback0Key key);
+
+ /** Returns user-param mapped to Key { int buffer } for <br> <code> public void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr)</code> **/
+ public Object getAlBufferCallback0UserParam(AlBufferCallback0Key key);
+
+ /** Releases all callback data mapped via Key { int buffer } skipping toolkit API. Favor passing `null` callback ref to <br> <code> public void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr)</code> **/
+ public int releaseAllAlBufferCallback0();
+
+ /** Releases callback data mapped to Key { int buffer } skipping toolkit API. Favor passing `null` callback ref to <br> <code> public void alBufferCallback0(int buffer, int format, int freq, ALBUFFERCALLBACKTYPESOFT callback, Object userptr)</code> **/
+ public void releaseAlBufferCallback0(AlBufferCallback0Key key);
+
+ /** Entry point (through function pointer) to C language function: <br> <code>void alEventCallbackInject(int eventType, int object, int param, const char * msg)</code><br> */
+ public void alEventCallbackInject(int eventType, int object, int param, String msg);
```
### JavaCallback Example 2b (Custom *KeyClass*)