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

ThreadWeaver

  • sources
  • kde-4.12
  • kdelibs
  • threadweaver
  • Weaver
ThreadWeaver.h
Go to the documentation of this file.
1 /* -*- C++ -*-
2 
3  This file implements the public interfaces of the Weaver and the Job class.
4  It should be the only include file necessary to use the ThreadWeaver
5  library.
6 
7  $ Author: Mirko Boehm $
8  $ Copyright: (C) 2005-2013 Mirko Boehm $
9  $ Contact: mirko@kde.org
10  http://www.kde.org
11  http://creative-destruction.me $
12 
13  This library is free software; you can redistribute it and/or
14  modify it under the terms of the GNU Library General Public
15  License as published by the Free Software Foundation; either
16  version 2 of the License, or (at your option) any later version.
17 
18  This library is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  Library General Public License for more details.
22 
23  You should have received a copy of the GNU Library General Public License
24  along with this library; see the file COPYING.LIB. If not, write to
25  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
26  Boston, MA 02110-1301, USA.
27 
28  $Id: ThreadWeaver.h 32 2005-08-17 08:38:01Z mirko $
29 */
30 #ifndef THREADWEAVER_H
31 #define THREADWEAVER_H
32 
33 #include <QtCore/QObject>
34 #include "WeaverInterface.h"
35 
36 namespace ThreadWeaver {
37 
38 class Job;
39 class State;
40 class WeaverObserver;
41 
64 // Note: All member documentation is in the WeaverInterface class.
65 class THREADWEAVER_EXPORT Weaver : public WeaverInterface
66 {
67  Q_OBJECT
68 public:
70  explicit Weaver ( QObject* parent=0 );
71 
73  virtual ~Weaver ();
74 
75  const State& state() const;
76 
77  void setMaximumNumberOfThreads( int cap );
78  int maximumNumberOfThreads() const;
79  int currentNumberOfThreads () const;
80 
81 
82  void registerObserver ( WeaverObserver* );
83 
91  // FIXME (0.7) this should be a WeaverInterface pointer
92  static ThreadWeaver::Weaver* instance();
93  virtual void enqueue (Job*);
94  virtual bool dequeue (Job*);
95  virtual void dequeue ();
96  virtual void finish();
97  virtual void suspend( );
98  virtual void resume();
99  bool isEmpty () const;
100  bool isIdle () const;
101  int queueLength () const;
102  void requestAbort();
103 
104 protected:
108  virtual WeaverInterface* makeWeaverImpl ();
109 
110 private:
111 
112  class Private;
113  Private* const d;
114 };
115 }
116 
117 #endif // THREADWEAVER_H
QObject
ThreadWeaver::Weaver
The Weaver class provides the public implementation of the WeaverInterface.
Definition: ThreadWeaver.h:65
ThreadWeaver::State
We use a State pattern to handle the system state in ThreadWeaver.
Definition: State.h:73
ThreadWeaver::WeaverInterface
WeaverInterface provides a common interface for weaver implementations.
Definition: WeaverInterface.h:61
WeaverInterface.h
ThreadWeaver::Job
A Job is a simple abstraction of an action that is to be executed in a thread context.
Definition: Job.h:65
ThreadWeaver::WeaverObserver
Observers provides signals on some Weaver events that are otherwise only available through objects of...
Definition: WeaverObserver.h:58
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:53 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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