• 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
State.h
Go to the documentation of this file.
1 /* -*- C++ -*-
2 
3  This file implements the state handling in ThreadWeaver.
4 
5  $ Author: Mirko Boehm $
6  $ Copyright: (C) 2005-2013 Mirko Boehm $
7  $ Contact: mirko@kde.org
8  http://www.kde.org
9  http://creative-destruction.me $
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: State.h 32 2005-08-17 08:38:01Z mirko $
27 */
28 
29 #ifndef THREADWEAVER_STATE_H
30 #define THREADWEAVER_STATE_H
31 
32 
33 
34 #include <threadweaver/threadweaver_export.h>
35 
36 namespace ThreadWeaver {
37 
38  class Job;
39  class Thread;
40  class WeaverInterface;
41 
48  enum StateId {
51  InConstruction = 0,
53  WorkingHard,
56  Suspending,
59  Suspended,
63  ShuttingDown,
66  Destructed,
68  NoOfStates
69  };
70 
73  class THREADWEAVER_EXPORT State
74  {
75  public:
77  explicit State( WeaverInterface *weaver );
78 
80  virtual ~State();
81 
85  QString stateName() const;
87  virtual StateId stateId() const = 0;
89  virtual void suspend() = 0;
91  virtual void resume() = 0;
96  virtual Job* applyForWork ( Thread *th, Job* previous ) = 0;
98  virtual void waitForAvailableJob ( Thread *th ) = 0;
101  virtual void activated();
102 
103  protected:
105  WeaverInterface* weaver();
106 
107  class Private;
108  Private * const d;
109  };
110 }
111 
112 #endif // THREADWEAVER_STATE_H
ThreadWeaver::Suspended
Job processing is suspended, and no jobs are being processed.
Definition: State.h:59
ThreadWeaver::Thread
The class Thread is used to represent the worker threads in the weaver's inventory.
Definition: Thread.h:46
ThreadWeaver::ShuttingDown
The object is being destructed.
Definition: State.h:63
ThreadWeaver::WorkingHard
Jobs are being processed.
Definition: State.h:53
ThreadWeaver::StateId
StateId
All weaver objects maintain a state of operation which can be queried by the application.
Definition: State.h:48
ThreadWeaver::Suspending
Job processing is suspended, but some jobs which where already in progress are not finished yet...
Definition: State.h:56
ThreadWeaver::Destructed
The object is being destructed, and all threads have exited.
Definition: State.h:66
threadweaver_export.h
ThreadWeaver::State
We use a State pattern to handle the system state in ThreadWeaver.
Definition: State.h:73
ThreadWeaver::State::d
Private *const d
Definition: State.h:107
ThreadWeaver::WeaverInterface
WeaverInterface provides a common interface for weaver implementations.
Definition: WeaverInterface.h:61
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::InConstruction
The object is in the state of construction and has not yet started to process jobs.
Definition: State.h:51
ThreadWeaver::NoOfStates
Not a state, but a sentinel for the number of defined states.
Definition: State.h:68
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