io.qt.core.QReadWriteLock Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.core;
import io.qt.*;
/**
* Read-write locking
* Java wrapper for Qt class QReadWriteLock
*/
public class QReadWriteLock extends QtObject
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Java wrapper for Qt enum QReadWriteLock::RecursionMode
*/
public enum RecursionMode implements QtEnumerator {
/**
* Representing QReadWriteLock:: NonRecursive
*/
NonRecursive(0),
/**
* Representing QReadWriteLock:: Recursive
*/
Recursive(1);
static {
QtJambi_LibraryUtilities.initialize();
}
private RecursionMode(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull RecursionMode resolve(int value) {
switch (value) {
case 0: return NonRecursive;
case 1: return Recursive;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* See QReadWriteLock:: QReadWriteLock(QReadWriteLock::RecursionMode)
*/
public QReadWriteLock(io.qt.core.QReadWriteLock.@NonNull RecursionMode recursionMode){
super((QPrivateConstructor)null);
initialize_native(this, recursionMode);
}
private native static void initialize_native(QReadWriteLock instance, io.qt.core.QReadWriteLock.RecursionMode recursionMode);
/**
* See QReadWriteLock:: lockForRead()
*/
@QtUninvokable
public final void lockForRead(){
lockForRead_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void lockForRead_native(long __this__nativeId);
/**
* See QReadWriteLock:: lockForWrite()
*/
@QtUninvokable
public final void lockForWrite(){
lockForWrite_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void lockForWrite_native(long __this__nativeId);
/**
* See QReadWriteLock:: tryLockForRead(QDeadlineTimer)
*/
@QtUninvokable
public final boolean tryLockForRead(io.qt.core.@NonNull QDeadlineTimer timeout){
return tryLockForRead_native_QDeadlineTimer(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(timeout));
}
@QtUninvokable
private native boolean tryLockForRead_native_QDeadlineTimer(long __this__nativeId, long timeout);
/**
* See QReadWriteLock:: tryLockForRead(int)
*/
@QtUninvokable
public final boolean tryLockForRead(int timeout){
return tryLockForRead_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), timeout);
}
@QtUninvokable
private native boolean tryLockForRead_native_int(long __this__nativeId, int timeout);
/**
* See QReadWriteLock:: tryLockForWrite(QDeadlineTimer)
*/
@QtUninvokable
public final boolean tryLockForWrite(io.qt.core.@NonNull QDeadlineTimer timeout){
return tryLockForWrite_native_QDeadlineTimer(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(timeout));
}
@QtUninvokable
private native boolean tryLockForWrite_native_QDeadlineTimer(long __this__nativeId, long timeout);
/**
* See QReadWriteLock:: tryLockForWrite(int)
*/
@QtUninvokable
public final boolean tryLockForWrite(int timeout){
return tryLockForWrite_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), timeout);
}
@QtUninvokable
private native boolean tryLockForWrite_native_int(long __this__nativeId, int timeout);
/**
*
*/
@QtUninvokable
public final void unlock(){
unlock_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void unlock_native(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QReadWriteLock(QPrivateConstructor p) { super(p); }
/**
* Overloaded constructor for {@link #QReadWriteLock(io.qt.core.QReadWriteLock.RecursionMode)}
* with recursionMode = io.qt.core.QReadWriteLock.RecursionMode.NonRecursive
.
*/
public QReadWriteLock() {
this(io.qt.core.QReadWriteLock.RecursionMode.NonRecursive);
}
/**
* Overloaded function for {@link #tryLockForRead(io.qt.core.QDeadlineTimer)}
* with timeout = new io.qt.core.QDeadlineTimer()
.
*/
@QtUninvokable
public final boolean tryLockForRead() {
return tryLockForRead(new io.qt.core.QDeadlineTimer());
}
/**
* Overloaded function for {@link #tryLockForRead(io.qt.core.QDeadlineTimer)}.
*/
@QtUninvokable
public final boolean tryLockForRead(io.qt.core.QDeadlineTimer.@NonNull ForeverConstant timeout) {
return tryLockForRead(new io.qt.core.QDeadlineTimer(timeout));
}
/**
* Overloaded function for {@link #tryLockForWrite(io.qt.core.QDeadlineTimer)}
* with timeout = new io.qt.core.QDeadlineTimer()
.
*/
@QtUninvokable
public final boolean tryLockForWrite() {
return tryLockForWrite(new io.qt.core.QDeadlineTimer());
}
/**
* Overloaded function for {@link #tryLockForWrite(io.qt.core.QDeadlineTimer)}.
*/
@QtUninvokable
public final boolean tryLockForWrite(io.qt.core.QDeadlineTimer.@NonNull ForeverConstant timeout) {
return tryLockForWrite(new io.qt.core.QDeadlineTimer(timeout));
}
}