io.qt.core.QReadWriteLock Maven / Gradle / Ivy
package io.qt.core;
/**
* Read-write locking
* Java wrapper for Qt class QReadWriteLock
*/
public class QReadWriteLock extends io.qt.QtObject
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Java wrapper for Qt enum QReadWriteLock::RecursionMode
*/
public enum RecursionMode implements io.qt.QtEnumerator {
NonRecursive(0),
Recursive(1);
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 RecursionMode resolve(int value) {
switch (value) {
case 0: return NonRecursive;
case 1: return Recursive;
default: throw new io.qt.QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* 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);
}
/**
* See QReadWriteLock::QReadWriteLock(QReadWriteLock::RecursionMode)
*/
public QReadWriteLock(io.qt.core.QReadWriteLock.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()
*/
@io.qt.QtUninvokable
public final void lockForRead(){
lockForRead_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native void lockForRead_native(long __this__nativeId);
/**
* See QReadWriteLock::lockForWrite()
*/
@io.qt.QtUninvokable
public final void lockForWrite(){
lockForWrite_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native void lockForWrite_native(long __this__nativeId);
/**
* See QReadWriteLock::tryLockForRead()
*/
@io.qt.QtUninvokable
public final boolean tryLockForRead(){
return tryLockForRead_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean tryLockForRead_native(long __this__nativeId);
/**
* See QReadWriteLock::tryLockForRead(int)
*/
@io.qt.QtUninvokable
public final boolean tryLockForRead(int timeout){
return tryLockForRead_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), timeout);
}
@io.qt.QtUninvokable
private native boolean tryLockForRead_native_int(long __this__nativeId, int timeout);
/**
* See QReadWriteLock::tryLockForWrite()
*/
@io.qt.QtUninvokable
public final boolean tryLockForWrite(){
return tryLockForWrite_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean tryLockForWrite_native(long __this__nativeId);
/**
* See QReadWriteLock::tryLockForWrite(int)
*/
@io.qt.QtUninvokable
public final boolean tryLockForWrite(int timeout){
return tryLockForWrite_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), timeout);
}
@io.qt.QtUninvokable
private native boolean tryLockForWrite_native_int(long __this__nativeId, int timeout);
/**
*
*/
@io.qt.QtUninvokable
public final void unlock(){
unlock_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native void unlock_native(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
*/
@io.qt.NativeAccess
protected QReadWriteLock(QPrivateConstructor p) { super(p); }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy