org.lwjgl.opencl.CLMemObjectDestructorCallback Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lwjgl-opencl Show documentation
Show all versions of lwjgl-opencl Show documentation
An open, royalty-free standard for cross-platform, parallel programming of diverse processors found in personal computers, servers, mobile devices and embedded platforms.
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.opencl;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/** Instances of this class may be passed to the {@link CL11#clSetMemObjectDestructorCallback SetMemObjectDestructorCallback} method. */
public abstract class CLMemObjectDestructorCallback extends Callback implements CLMemObjectDestructorCallbackI {
/** Creates a {@code CLMemObjectDestructorCallback} instance from the specified function pointer. */
public static CLMemObjectDestructorCallback create(long functionPointer) {
if ( functionPointer == NULL )
return null;
CLMemObjectDestructorCallbackI instance = Callback.get(functionPointer);
return instance instanceof CLMemObjectDestructorCallback
? (CLMemObjectDestructorCallback)instance
: new Container(functionPointer, instance);
}
/** Creates a {@code CLMemObjectDestructorCallback} instance that delegates to the specified {@code CLMemObjectDestructorCallbackI} instance. */
public static CLMemObjectDestructorCallback create(CLMemObjectDestructorCallbackI instance) {
return instance instanceof CLMemObjectDestructorCallback
? (CLMemObjectDestructorCallback)instance
: new Container(instance.address(), instance);
}
protected CLMemObjectDestructorCallback() {
super(SIGNATURE);
}
private CLMemObjectDestructorCallback(long functionPointer) {
super(functionPointer);
}
private static final class Container extends CLMemObjectDestructorCallback {
private final CLMemObjectDestructorCallbackI delegate;
Container(long functionPointer, CLMemObjectDestructorCallbackI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public void invoke(long memobj, long user_data) {
delegate.invoke(memobj, user_data);
}
}
}