Public Member Functions | Protected Attributes

QFutureSynchronizer< T > Class Template Reference

Search for all occurrences

Detailed Description

template<typename T>
class QFutureSynchronizer< T >

Definition at line 55 of file qfuturesynchronizer.h.

#include <qfuturesynchronizer.h>

List of all members.

Public Member Functions

  QFutureSynchronizer ()
  QFutureSynchronizer (const QFuture< T > &future)
  ~QFutureSynchronizer ()
void  setFuture (const QFuture< T > &future)
void  addFuture (const QFuture< T > &future)
void  waitForFinished ()
void  clearFutures ()
QList< QFuture< T > >  futures () const
void  setCancelOnWait (bool enabled)
bool  cancelOnWait () const

Protected Attributes

QList< QFuture< T > >  m_futures
bool  m_cancelOnWait

Constructor & Destructor Documentation

QFutureSynchronizer ( ) [inline]

Definition at line 60 of file qfuturesynchronizer.h.

: m_cancelOnWait(false) { }
QFutureSynchronizer ( const QFuture< T > &  future ) [inline, explicit]

Definition at line 61 of file qfuturesynchronizer.h.

        : m_cancelOnWait(false)
    { addFuture(future); }
~QFutureSynchronizer ( ) [inline]

Definition at line 64 of file qfuturesynchronizer.h.


Member Function Documentation

void setFuture ( const QFuture< T > &  future ) [inline]
void addFuture ( const QFuture< T > &  future ) [inline]

Definition at line 73 of file qfuturesynchronizer.h.

    {
        m_futures.append(future);
    }
void waitForFinished ( ) [inline]

Definition at line 78 of file qfuturesynchronizer.h.

    {
        if (m_cancelOnWait) {
            for (int i = 0; i < m_futures.count(); ++i) {
                 m_futures[i].cancel();
            }
        }
        
        for (int i = 0; i < m_futures.count(); ++i) {
             m_futures[i].waitForFinished();
         }
    }
void clearFutures ( ) [inline]
QList<QFuture<T> > futures ( ) const [inline]

Definition at line 96 of file qfuturesynchronizer.h.

    {
        return m_futures;
    }
void setCancelOnWait ( bool  enabled ) [inline]

Definition at line 101 of file qfuturesynchronizer.h.

    {
        m_cancelOnWait = enabled;
    }
bool cancelOnWait ( ) const [inline]

Definition at line 106 of file qfuturesynchronizer.h.

    {
        return m_cancelOnWait;
    }

Member Data Documentation

QList<QFuture<T> > m_futures [protected]
bool m_cancelOnWait [protected]

The documentation for this class was generated from the following file: