All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.qt.core.QFunctionPointer Maven / Gradle / Ivy

The newest version!
package io.qt.core;


/**
 * 

Java wrapper for Qt function pointer QFunctionPointer

*/ public final class QFunctionPointer extends io.qt.QtObject { static { QtJambi_LibraryUtilities.initialize(); } private QFunctionPointer(QPrivateConstructor c){ super(c); } /** * Overloaded function for invoke(void.class, arguments). * @param arguments */ @io.qt.QtDeclaredFinal @io.qt.QtUninvokable public void invoke(Object... arguments) throws io.qt.QUnsuccessfulInvocationException { invoke_native(this, void.class, arguments); } /** * Overloaded function for invoke(QGenericReturnType.of(returnType), arguments). * @param returnType * @param arguments */ @io.qt.QtDeclaredFinal @io.qt.QtUninvokable public R invoke(Class returnType, Object... arguments) throws io.qt.QUnsuccessfulInvocationException { return invoke_native(this, returnType, arguments); } /** *

Invokes the underlying function pointer with given arguments.

*

Object types are used as pointers, value types as call-by-value. This also applies for the return value.

*

Use {@link QGenericArgument} to specify call-by-reference. * E.g. QGenericArgument.value("any string").asConstRef() * for const QString&

*

Requires Java Native Access library (JNA) in class path.

* @see https://github.com/java-native-access/jna * @param returnType * @param arguments argument values or wrapped as QGenericArgument */ @io.qt.QtUninvokable public R invoke(QGenericReturnType returnType, Object... arguments) throws io.qt.QUnsuccessfulInvocationException { if(arguments==null) { return invoke_native(this, returnType, null); }else { return invoke_native(this, returnType, arguments); } } /** * Converts this function pointer into given functional interface type. * @param functionalInterface * @return converted function pointer */ @io.qt.QtUninvokable public T cast(Class functionalInterface) { return cast(this, functionalInterface); } /** * Converts the given function into given functional interface type. * @param functionalInterface * @return converted function pointer */ @io.qt.QtUninvokable public native static T cast(io.qt.QtObjectInterface function, Class functionalInterface); @io.qt.QtUninvokable static native R invoke_native(io.qt.QtObjectInterface function, Object returnType, Object[] arguments); public native void invoke(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy