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

ThreadWeaver

  • threadweaver
  • Weaver
JobCollection_p.h
Go to the documentation of this file.
1/* -*- C++ -*-
2
3 This file implements the JobCollection 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: DebuggingAids.h 30 2005-08-16 16:16:04Z mirko $
27*/
28
29#ifndef THREADWEAVER_JOBCOLLECTION_P_H
30#define THREADWEAVER_JOBCOLLECTION_P_H
31
32#include "JobCollection.h"
33#include "WeaverInterface.h"
34
35#include <QtCore/QObject>
36#include <QtCore/QPointer>
37
38using namespace ThreadWeaver;
39
40/* QPointers are used internally to be able to dequeue jobs at destruction
41 time. The owner of the jobs could have deleted them in the meantime.
42 We use a class instead of a typedef to be able to forward-declare the
43 class in the declaration.
44*/
45class ThreadWeaver::JobCollectionJobRunner : public Job
46{
47 Q_OBJECT
48
49public:
50 JobCollectionJobRunner ( JobCollection* collection, Job* payload, QObject* parent );
51
52 bool canBeExecuted();
53
54 Job* payload ();
55
56 void aboutToBeQueued ( WeaverInterface *weaver );
57
58 void aboutToBeDequeued ( WeaverInterface *weaver );
59
60 void execute ( Thread *t );
61
62 int priority () const;
63
64private:
65 void run ();
66
67 QPointer<Job> m_payload;
68 JobCollection* m_collection;
69};
70
71#endif // THREADWEAVER_JOBCOLLECTION_P_H
JobCollection.h
WeaverInterface.h
QObject
ThreadWeaver::JobCollectionJobRunner
Definition: JobCollection_p.h:46
ThreadWeaver::JobCollectionJobRunner::canBeExecuted
bool canBeExecuted()
canBeExecuted() returns true if all the jobs queue policies agree to it.
Definition: JobCollection.cpp:58
ThreadWeaver::JobCollectionJobRunner::aboutToBeDequeued
void aboutToBeDequeued(WeaverInterface *weaver)
This Job is about the be dequeued from the weaver's job queue.
Definition: JobCollection.cpp:73
ThreadWeaver::JobCollectionJobRunner::priority
int priority() const
The queueing priority of the job.
Definition: JobCollection.cpp:90
ThreadWeaver::JobCollectionJobRunner::payload
Job * payload()
Definition: JobCollection.cpp:63
ThreadWeaver::JobCollectionJobRunner::execute
void execute(Thread *t)
Perform the job.
Definition: JobCollection.cpp:78
ThreadWeaver::JobCollectionJobRunner::aboutToBeQueued
void aboutToBeQueued(WeaverInterface *weaver)
The job is about to be added to the weaver's job queue.
Definition: JobCollection.cpp:68
ThreadWeaver::JobCollection
A JobCollection is a vector of Jobs that will be queued together.
Definition: JobCollection.h:50
ThreadWeaver::Job
A Job is a simple abstraction of an action that is to be executed in a thread context.
Definition: Job.h:66
ThreadWeaver::Thread
The class Thread is used to represent the worker threads in the weaver's inventory.
Definition: Thread.h:47
ThreadWeaver::WeaverInterface
WeaverInterface provides a common interface for weaver implementations.
Definition: WeaverInterface.h:61
ThreadWeaver
Definition: DebuggingAids.h:51
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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.14.38 API Reference

Skip menu "kdelibs-4.14.38 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