• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.2 API Reference
  • KDE Home
  • Contact Us
 

ThreadWeaver

  • threadweaver
  • Weaver
Job.h
Go to the documentation of this file.
1 /* -*- C++ -*-
2 
3 This file declares the Job class.
4 
5 $ Author: Mirko Boehm $
6 $ Copyright: (C) 2004, 2005, 2006 Mirko Boehm $
7 $ Contact: mirko@kde.org
8 http://www.kde.org
9 http://www.hackerbuero.org $
10 
11  This library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU Library General Public
13  License as published by the Free Software Foundation; either
14  version 2 of the License, or (at your option) any later version.
15 
16  This library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  Library General Public License for more details.
20 
21  You should have received a copy of the GNU Library General Public License
22  along with this library; see the file COPYING.LIB. If not, write to
23  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24  Boston, MA 02110-1301, USA.
25 
26 $Id: Job.h 32 2005-08-17 08:38:01Z mirko $
27 */
28 
29 #ifndef THREADWEAVER_JOB_H
30 #define THREADWEAVER_JOB_H
31 
32 #include <QtCore/QObject>
33 
34 #include <threadweaver/threadweaver_export.h>
35 
36 class QMutex;
37 class QWaitCondition;
38 
39 namespace ThreadWeaver {
40 
41  class Thread;
42  class QueuePolicy;
43  class JobRunHelper;
44  class WeaverInterface;
45  class QueuePolicyList;
46 
65  class THREADWEAVER_EXPORT Job : public QObject
66  {
67  Q_OBJECT
68 
69  public:
70  friend class JobRunHelper;
71 
76  explicit Job ( QObject* parent = 0 );
77 
79  virtual ~Job();
80 
85  virtual void execute(Thread*);
86 
101  virtual int priority() const;
102 
118  virtual bool success () const;
119 
134  // FIXME (Mirko) this should be private, I guess?
135  virtual void requestAbort () {}
136 
150  virtual void aboutToBeQueued ( WeaverInterface *weaver );
151 
165  virtual void aboutToBeDequeued ( WeaverInterface *weaver );
166 
175  virtual bool canBeExecuted();
176 
178  bool isFinished() const;
179 
187  void assignQueuePolicy ( QueuePolicy* );
188 
191  void removeQueuePolicy ( QueuePolicy* );
192 
193  Q_SIGNALS:
196  void started ( ThreadWeaver::Job* );
202  void done ( ThreadWeaver::Job* );
203 
208  void failed( ThreadWeaver::Job* );
209 
210  protected:
211  class Private;
212  Private* d;
213 
216  void freeQueuePolicyResources();
217 
221  virtual void run () = 0;
228  Thread *thread();
229 
231  void setFinished ( bool status );
232 
234  // QMutex& mutex();
235 
236  };
237 }
238 
239 #endif // THREADWEAVER_JOB_H
240 
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Apr 20 2013 06:01:04 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

ThreadWeaver

Skip menu "ThreadWeaver"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.10.2 API Reference

Skip menu "kdelibs-4.10.2 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal