io.qt.core.QSemaphore Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of qtjambi Show documentation
Show all versions of qtjambi Show documentation
QtJambi base module containing QtCore, QtGui and QtWidgets.
package io.qt.core;
import io.qt.*;
/**
* General counting semaphore
* Java wrapper for Qt class QSemaphore
*/
public class QSemaphore extends QtObject
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* See QSemaphore:: QSemaphore(int)
*/
public QSemaphore(int n){
super((QPrivateConstructor)null);
initialize_native(this, n);
}
private native static void initialize_native(QSemaphore instance, int n);
/**
*
*/
@QtUninvokable
public final void acquire(int n){
acquire_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), n);
}
@QtUninvokable
private native void acquire_native_int(long __this__nativeId, int n);
/**
* See QSemaphore:: available()const
*/
@QtUninvokable
public final int available(){
return available_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int available_native_constfct(long __this__nativeId);
/**
*
*/
@QtUninvokable
public final void release(int n){
release_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), n);
}
@QtUninvokable
private native void release_native_int(long __this__nativeId, int n);
/**
* See QSemaphore:: tryAcquire(int)
*/
@QtUninvokable
public final boolean tryAcquire(int n){
return tryAcquire_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), n);
}
@QtUninvokable
private native boolean tryAcquire_native_int(long __this__nativeId, int n);
/**
* See QSemaphore:: tryAcquire(int, QDeadlineTimer)
*/
@QtUninvokable
public final boolean tryAcquire(int n, io.qt.core.@NonNull QDeadlineTimer timeout){
return tryAcquire_native_int_QDeadlineTimer(QtJambi_LibraryUtilities.internal.nativeId(this), n, QtJambi_LibraryUtilities.internal.checkedNativeId(timeout));
}
@QtUninvokable
private native boolean tryAcquire_native_int_QDeadlineTimer(long __this__nativeId, int n, long timeout);
/**
* See QSemaphore:: tryAcquire(int, int)
*/
@QtUninvokable
public final boolean tryAcquire(int n, int timeout){
return tryAcquire_native_int_int(QtJambi_LibraryUtilities.internal.nativeId(this), n, timeout);
}
@QtUninvokable
private native boolean tryAcquire_native_int_int(long __this__nativeId, int n, int timeout);
/**
*
*/
@QtUninvokable
public final boolean try_acquire(){
return try_acquire_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean try_acquire_native(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QSemaphore(QPrivateConstructor p) { super(p); }
/**
* Overloaded constructor for {@link #QSemaphore(int)}
* with n = 0
.
*/
public QSemaphore() {
this((int)0);
}
/**
* Overloaded function for {@link #acquire(int)}
* with n = 1
.
*/
@QtUninvokable
public final void acquire() {
acquire((int)1);
}
/**
* Overloaded function for {@link #release(int)}
* with n = 1
.
*/
@QtUninvokable
public final void release() {
release((int)1);
}
/**
* Overloaded function for {@link #tryAcquire(int)}
* with n = 1
.
*/
@QtUninvokable
public final boolean tryAcquire() {
return tryAcquire((int)1);
}
/**
* Overloaded function for {@link #tryAcquire(int, io.qt.core.QDeadlineTimer)}.
*/
@QtUninvokable
public final boolean tryAcquire(int n, io.qt.core.QDeadlineTimer.@NonNull ForeverConstant timeout) {
return tryAcquire(n, new io.qt.core.QDeadlineTimer(timeout));
}
}