libXDispatch 0.6
include/QtDispatch/qdispatchqueue.h
Go to the documentation of this file.
00001 /*
00002 * Copyright (c) 2011 MLBA. All rights reserved.
00003 *
00004 * @MLBA_OPEN_LICENSE_HEADER_START@
00005 *
00006 * Licensed under the Apache License, Version 2.0 (the "License");
00007 * you may not use this file except in compliance with the License.
00008 * You may obtain a copy of the License at
00009 * 
00010 *     http://www.apache.org/licenses/LICENSE-2.0
00011 * 
00012 * Unless required by applicable law or agreed to in writing, software
00013 * distributed under the License is distributed on an "AS IS" BASIS,
00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015 * See the License for the specific language governing permissions and
00016 * limitations under the License.
00017 *
00018 * @MLBA_OPEN_LICENSE_HEADER_END@
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        /* virtual void set_finalizer(xdispatch::operation*, const xdispatch::queue& = xdispatch::global_queue());
00135        #ifdef XDISPATCH_HAS_BLOCKS
00136        virtual void set_finalizer(dispatch_block_t, const xdispatch::queue& = xdispatch::global_queue());
00137        #endif
00138        virtual void set_target(const xdispatch::queue&); */
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 /* QDISPATCH_QUEUE */

Generated on Wed Feb 22 2012 19:57:00 for libXDispatch by Doxygen 1.7.4
Content © 2011-2012 MLBA (about | privacy) – Design © 2010-2012 Emzeat. All Rights reserved.