Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef QDISPATCH_QUEUE
00024 #define QDISPATCH_QUEUE
00025
00026 #include <qobject.h>
00027 #include "../xdispatch/dispatch.h"
00028 #include "qdispatchglobal.h"
00029
00030 QT_BEGIN_HEADER
00031 QT_BEGIN_NAMESPACE
00032
00033 class QTime;
00034 class QRunnable;
00035 class QIterationRunnable;
00036
00037 QT_MODULE(Dispatch)
00038
00039
00050 class Q_DISPATCH_EXPORT QDispatchQueue : public QObject, public xdispatch::queue {
00051
00052 Q_OBJECT
00053
00054 public:
00055 QDispatchQueue(const QString& label);
00056 QDispatchQueue(const char*);
00057 QDispatchQueue(dispatch_queue_t);
00058 QDispatchQueue(const xdispatch::queue&);
00059 QDispatchQueue(const QDispatchQueue&);
00060 ~QDispatchQueue();
00061
00066 virtual void async(QRunnable*);
00067 using xdispatch::queue::async;
00078 virtual void apply(QIterationRunnable*, int times);
00079 using xdispatch::queue::apply;
00086 virtual void after(QRunnable*, const QTime& time);
00087 virtual void after(QRunnable*, dispatch_time_t time);
00088 using xdispatch::queue::after;
00089 #ifdef XDISPATCH_HAS_BLOCKS
00090
00095 virtual void after(dispatch_block_t, const QTime& time);
00096 #endif
00097
00102 virtual void sync(QRunnable*);
00103 using xdispatch::queue::sync;
00114 virtual void setFinalizer(QRunnable*, const xdispatch::queue& = xdispatch::global_queue());
00115 virtual void setFinalizer(xdispatch::operation*, const xdispatch::queue& = xdispatch::global_queue());
00116 #ifdef XDISPATCH_HAS_BLOCKS
00117 virtual void setFinalizer(dispatch_block_t, const xdispatch::queue& = xdispatch::global_queue());
00118 #endif
00119
00125 virtual void setTarget(const xdispatch::queue&);
00126
00127 QDispatchQueue& operator=(const QDispatchQueue&);
00128
00129 public slots:
00130 void suspend();
00131 void resume();
00132
00133 private:
00134
00135
00136
00137
00138
00139 };
00140
00141 Q_DECL_EXPORT QDebug operator<<(QDebug dbg, const QDispatchQueue* q);
00142 Q_DECL_EXPORT QDebug operator<<(QDebug dbg, const QDispatchQueue& q);
00143
00144 QT_END_NAMESPACE
00145 QT_END_HEADER
00146
00147 #endif