ThreadWeaver
Thread.h
Go to the documentation of this file.
00001 /* -*- C++ -*- 00002 00003 This file declares the Thread class. 00004 00005 Thread is not a part of the public interface of the ThreadWeaver library. 00006 00007 $ Author: Mirko Boehm $ 00008 $ Copyright: (C) 2004, 2005, 2006 Mirko Boehm $ 00009 $ Contact: mirko@kde.org 00010 http://www.kde.org 00011 http://www.hackerbuero.org $ 00012 00013 This library is free software; you can redistribute it and/or 00014 modify it under the terms of the GNU Library General Public 00015 License as published by the Free Software Foundation; either 00016 version 2 of the License, or (at your option) any later version. 00017 00018 This library is distributed in the hope that it will be useful, 00019 but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00021 Library General Public License for more details. 00022 00023 You should have received a copy of the GNU Library General Public License 00024 along with this library; see the file COPYING.LIB. If not, write to 00025 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00026 Boston, MA 02110-1301, USA. 00027 00028 $Id: Thread.h 32 2005-08-17 08:38:01Z mirko $ 00029 */ 00030 00031 #ifndef THREADWEAVER_THREAD_H 00032 #define THREADWEAVER_THREAD_H 00033 00034 #include <QtCore/QMutex> 00035 #include <QtCore/QThread> 00036 00037 #include <threadweaver/threadweaver_export.h> 00038 00039 namespace ThreadWeaver { 00040 00041 class Job; 00042 class WeaverImpl; 00043 class ThreadRunHelper; 00044 00047 class THREADWEAVER_EXPORT Thread : public QThread 00048 { 00049 Q_OBJECT 00050 00051 public: 00058 explicit Thread ( WeaverImpl *parent = 0 ); 00059 00061 ~Thread(); 00062 00069 void run(); 00070 00071 // FIXME (0.7) provide usleep and sleep, too 00076 void msleep ( unsigned long msec ); 00077 00087 unsigned int id(); 00088 00094 void requestAbort(); 00095 00096 Q_SIGNALS: 00098 void started ( ThreadWeaver::Thread* ); 00100 void jobStarted ( ThreadWeaver::Thread*, ThreadWeaver::Job* ); 00102 void jobDone ( ThreadWeaver::Job* ); 00103 00104 private: 00105 class Private; 00106 Private * const d; 00107 }; 00108 00109 } 00110 00111 #endif 00112 00113
KDE 4.6 API Reference