io.qt.core.QThreadPool Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.core;
import io.qt.*;
/**
* Manages a collection of QThreads
* Java wrapper for Qt class QThreadPool
*/
public class QThreadPool extends io.qt.core.QObject
{
/**
* This variable stores the meta-object for the class.
*/
public static final io.qt.core.@NonNull QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QThreadPool.class);
/**
* See QThreadPool:: QThreadPool(QObject*)
*/
public QThreadPool(io.qt.core.@Nullable QObject parent){
super((QPrivateConstructor)null);
initialize_native(this, parent);
}
private native static void initialize_native(QThreadPool instance, io.qt.core.QObject parent);
/**
* See QThreadPool:: activeThreadCount()const
*/
@QtPropertyReader(name="activeThreadCount")
@QtUninvokable
public final int activeThreadCount(){
return activeThreadCount_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int activeThreadCount_native_constfct(long __this__nativeId);
/**
*
*/
@QtUninvokable
public final void clear(){
clear_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void clear_native(long __this__nativeId);
/**
* See QThreadPool:: contains(const QThread*)const
*/
@QtUninvokable
public final boolean contains(io.qt.core.@Nullable QThread thread){
return contains_native_const_QThread_ptr_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(thread));
}
@QtUninvokable
private native boolean contains_native_const_QThread_ptr_constfct(long __this__nativeId, long thread);
/**
* See QThreadPool:: expiryTimeout()const
*/
@QtPropertyReader(name="expiryTimeout")
@QtUninvokable
public final int expiryTimeout(){
return expiryTimeout_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int expiryTimeout_native_constfct(long __this__nativeId);
/**
* See QThreadPool:: maxThreadCount()const
*/
@QtPropertyReader(name="maxThreadCount")
@QtUninvokable
public final int maxThreadCount(){
return maxThreadCount_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int maxThreadCount_native_constfct(long __this__nativeId);
/**
* See QThreadPool:: releaseThread()
*/
@QtUninvokable
public final void releaseThread(){
releaseThread_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void releaseThread_native(long __this__nativeId);
/**
* See QThreadPool:: reserveThread()
*/
@QtUninvokable
public final void reserveThread(){
reserveThread_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void reserveThread_native(long __this__nativeId);
/**
* See QThreadPool:: setExpiryTimeout(int)
*/
@QtPropertyWriter(name="expiryTimeout")
@QtUninvokable
public final void setExpiryTimeout(int expiryTimeout){
setExpiryTimeout_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), expiryTimeout);
}
@QtUninvokable
private native void setExpiryTimeout_native_int(long __this__nativeId, int expiryTimeout);
/**
* See QThreadPool:: setMaxThreadCount(int)
*/
@QtPropertyWriter(name="maxThreadCount")
@QtUninvokable
public final void setMaxThreadCount(int maxThreadCount){
setMaxThreadCount_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), maxThreadCount);
}
@QtUninvokable
private native void setMaxThreadCount_native_int(long __this__nativeId, int maxThreadCount);
/**
* See QThreadPool:: setStackSize(uint)
*/
@QtPropertyWriter(name="stackSize")
@QtUninvokable
public final void setStackSize(int stackSize){
setStackSize_native_uint(QtJambi_LibraryUtilities.internal.nativeId(this), stackSize);
}
@QtUninvokable
private native void setStackSize_native_uint(long __this__nativeId, int stackSize);
/**
* See QThreadPool:: setThreadPriority(QThread::Priority)
*/
@QtPropertyWriter(name="threadPriority")
@QtUninvokable
public final void setThreadPriority(io.qt.core.QThread.@NonNull Priority priority){
setThreadPriority_native_QThread_Priority(QtJambi_LibraryUtilities.internal.nativeId(this), priority.value());
}
@QtUninvokable
private native void setThreadPriority_native_QThread_Priority(long __this__nativeId, int priority);
/**
* See QThreadPool:: stackSize()const
*/
@QtPropertyReader(name="stackSize")
@QtUninvokable
public final int stackSize(){
return stackSize_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int stackSize_native_constfct(long __this__nativeId);
/**
* See QThreadPool:: start(QRunnable*, int)
*/
@QtUninvokable
public final void start(java.lang.@Nullable Runnable runnable, int priority){
start_native_QRunnable_ptr_int(QtJambi_LibraryUtilities.internal.nativeId(this), runnable, priority);
}
@QtUninvokable
private native void start_native_QRunnable_ptr_int(long __this__nativeId, java.lang.Runnable runnable, int priority);
/**
* See QThreadPool:: startOnReservedThread(QRunnable*)
*/
@QtUninvokable
public final void startOnReservedThread(java.lang.@Nullable Runnable runnable){
startOnReservedThread_native_QRunnable_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), runnable);
}
@QtUninvokable
private native void startOnReservedThread_native_QRunnable_ptr(long __this__nativeId, java.lang.Runnable runnable);
/**
* See QThreadPool:: threadPriority()const
*/
@QtPropertyReader(name="threadPriority")
@QtUninvokable
public final io.qt.core.QThread.@NonNull Priority threadPriority(){
return io.qt.core.QThread.Priority.resolve(threadPriority_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int threadPriority_native_constfct(long __this__nativeId);
/**
* See QThreadPool:: tryStart(QRunnable*)
*/
@QtUninvokable
public final boolean tryStart(java.lang.@StrictNonNull Runnable runnable){
java.util.Objects.requireNonNull(runnable, "Argument 'runnable': null not expected.");
return tryStart_native_QRunnable_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), runnable);
}
@QtUninvokable
private native boolean tryStart_native_QRunnable_ptr(long __this__nativeId, java.lang.Runnable runnable);
/**
* See QThreadPool:: tryTake(QRunnable*)
*/
@QtUninvokable
public final boolean tryTake(io.qt.core.@Nullable QRunnable runnable){
return tryTake_native_QRunnable_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(runnable));
}
@QtUninvokable
private native boolean tryTake_native_QRunnable_ptr(long __this__nativeId, long runnable);
/**
* See QThreadPool:: waitForDone(int)
*/
@QtUninvokable
public final boolean waitForDone(int msecs){
return waitForDone_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), msecs);
}
@QtUninvokable
private native boolean waitForDone_native_int(long __this__nativeId, int msecs);
/**
* See QThreadPool:: globalInstance()
*/
public native static io.qt.core.@Nullable QThreadPool globalInstance();
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QThreadPool(QPrivateConstructor p) { super(p); }
/**
* Constructor for internal use only.
* It is not allowed to call the declarative constructor from inside Java.
* @hidden
*/
@NativeAccess
protected QThreadPool(QDeclarativeConstructor constructor) {
super((QPrivateConstructor)null);
initialize_native(this, constructor);
}
@QtUninvokable
private static native void initialize_native(QThreadPool instance, QDeclarativeConstructor constructor);
/**
* Overloaded constructor for {@link #QThreadPool(io.qt.core.QObject)}
* with parent = null
.
*/
public QThreadPool() {
this((io.qt.core.QObject)null);
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #activeThreadCount()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final int getActiveThreadCount() {
return activeThreadCount();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #expiryTimeout()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final int getExpiryTimeout() {
return expiryTimeout();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #maxThreadCount()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final int getMaxThreadCount() {
return maxThreadCount();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #stackSize()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final int getStackSize() {
return stackSize();
}
/**
* Overloaded function for {@link #start(java.lang.Runnable, int)}
* with priority = 0
.
*/
@QtUninvokable
public final void start(java.lang.@Nullable Runnable runnable) {
start(runnable, (int)0);
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #threadPriority()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final io.qt.core.QThread.@NonNull Priority getThreadPriority() {
return threadPriority();
}
/**
* Overloaded function for {@link #waitForDone(int)}
* with msecs = -1
.
*/
@QtUninvokable
public final boolean waitForDone() {
return waitForDone((int)-1);
}
}