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

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

There is a newer version: 6.8.0
Show newest version
package io.qt.core;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 

Convenience class that simplifies QFuture synchronization

*

Java wrapper for Qt class QFutureSynchronizer

*/ public final class QFutureSynchronizer { static { QtJambi_LibraryUtilities.initialize(); } /** *

See QFutureSynchronizer::QFutureSynchronizer()

*/ public QFutureSynchronizer(){ super(); } /** *

See QFutureSynchronizer::QFutureSynchronizer(QFuture<T>)

*/ public QFutureSynchronizer(QFuture future){ super(); addFuture(future); } /** *

See QFutureSynchronizer::addFuture(QFuture<T>)

*/ @io.qt.QtUninvokable public final void addFuture(QFuture future){ m_futures.add(future); } /** *

See QFutureSynchronizer::cancelOnWait()const

*/ @io.qt.QtUninvokable public final boolean cancelOnWait(){ return m_cancelOnWait; } /** *

See QFutureSynchronizer::clearFutures()

*/ @io.qt.QtUninvokable public final void clearFutures(){ m_futures.clear(); } /** *

See QFutureSynchronizer::setCancelOnWait(bool)

*/ @io.qt.QtUninvokable public final void setCancelOnWait(boolean enabled){ this.m_cancelOnWait = enabled; } /** *

See QFutureSynchronizer::setFuture(QFuture<T>)

*/ @io.qt.QtUninvokable public final void setFuture(QFuture future){ waitForFinished(); m_futures.clear(); addFuture(future); } /** *

See QFutureSynchronizer::waitForFinished()const

*/ @io.qt.QtUninvokable public final void waitForFinished(){ if (m_cancelOnWait) { for (int i = 0; i < m_futures.size(); ++i) { m_futures.get(i).cancel(); } } for (int i = 0; i < m_futures.size(); ++i) { m_futures.get(i).waitForFinished(); } } /** *

See QFutureSynchronizer::futures()const

*/ @io.qt.QtUninvokable public final List> futures() { return Collections.unmodifiableList(m_futures); } private final List> m_futures = new ArrayList<>(); private boolean m_cancelOnWait; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy