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

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

The 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::

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

See QFutureSynchronizer::

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

See QFutureSynchronizer::

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

See QFutureSynchronizer::

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

See QFutureSynchronizer::

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

See QFutureSynchronizer::

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

See QFutureSynchronizer::

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

See QFutureSynchronizer::

*/ @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