<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US"> <head> <title>libkdepim: weaver.h Source File (libkdepim)</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="pics-label" content='(pics-1.1 "http://www.icra.org/ratingsv02.html" comment "ICRAonline DE v2.0" l gen true for "http://www.kde.org" r (nz 1 vz 1 lz 1 oz 1 cb 1) "http://www.rsac.org/ratingsv01.html" l gen true for "http://www.kde.org" r (n 0 s 0 v 0 l 0))' /> <meta name="trademark" content="KDE e.V." /> <meta name="description" content="K Desktop Environment Homepage, KDE.org" /> <meta name="MSSmartTagsPreventParsing" content="true" /> <meta name="robots" content="all" /> <link rel="shortcut icon" href="../../favicon.ico" /> <link rel="stylesheet" media="screen" type="text/css" title="APIDOX" href="doxygen.css" /> <style type="text/css"> <!-- hr { display: none; } #content h2 { margin-left: 0px; } table.mdTable { background-color: #f8f8f8; border: .2em solid #d7d7d7; } td.mdRow { padding: 8px 20px; } td.md { font-weight: bold; } td.mdname1 { font-weight: bold; color: #602020; } td.mdname { font-weight: bold; color: #602020; } --> </style> </head> <body> <div id="nav_header_top" align="right"> <a href="#content" class="doNotDisplay" accesskey="2">Skip to main content ::</a> <a href="../.."><img id="nav_header_logo" alt="Home" align="left" src="../../kde_gear_64.png" border="0" /></a> <span class="doNotDisplay">::</span> <img id="nav_header_logo_right" alt="" align="right" src="../../pimlogo.png" border="0" /> <div id="nav_header_title" align="left">KDE PIM API Reference</div> </div> <div id="nav_header_bottom" align="right"> <span class="doNotDisplay">:: <a href="#navigation" accesskey="5">Skip to Link Menu</a><br/></span> <div id="nav_header_bottom_left" style="text-align: left;"> / <a href="../../">API Reference</a> / <a href=".">libkdepim</a> </div> </div> <table id="main" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td valign="top" class="menuheader" height="0"></td> <td id="contentcolumn" valign="top" rowspan="2" > <div id="content" style="padding-top: 0px;"><div style="width:100%; margin: 0px; padding: 0px;"> <h2><a name="content"></a>libkdepim</h2> <!-- Generated by Doxygen 1.5.5 --> <h1>weaver.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- C++ -*-</span> <a name="l00002"></a>00002 <span class="comment"></span> <a name="l00003"></a>00003 <span class="comment"> This file declares the Weaver, Job and Thread classes.</span> <a name="l00004"></a>00004 <span class="comment"></span> <a name="l00005"></a>00005 <span class="comment"> $ Author: Mirko Boehm $</span> <a name="l00006"></a>00006 <span class="comment"> $ Copyright: (C) 2004, Mirko Boehm $</span> <a name="l00007"></a>00007 <span class="comment"> $ Contact: mirko@kde.org</span> <a name="l00008"></a>00008 <span class="comment"> http://www.kde.org</span> <a name="l00009"></a>00009 <span class="comment"> http://www.hackerbuero.org $</span> <a name="l00010"></a>00010 <span class="comment"> $ License: LGPL with the following explicit clarification:</span> <a name="l00011"></a>00011 <span class="comment"> This code may be linked against any version of the Qt toolkit</span> <a name="l00012"></a>00012 <span class="comment"> from Troll Tech, Norway. $</span> <a name="l00013"></a>00013 <span class="comment"></span> <a name="l00014"></a>00014 <span class="comment">*/</span> <a name="l00015"></a>00015 <a name="l00016"></a>00016 <span class="preprocessor">#ifndef WEAVER_H</span> <a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define WEAVER_H</span> <a name="l00018"></a>00018 <span class="preprocessor"></span> <a name="l00019"></a>00019 <span class="keyword">extern</span> <span class="stringliteral">"C"</span> <a name="l00020"></a>00020 { <a name="l00021"></a>00021 <span class="preprocessor">#include <stdarg.h></span> <a name="l00022"></a>00022 <span class="preprocessor">#include <unistd.h></span> <a name="l00023"></a>00023 <span class="preprocessor">#include <stdio.h></span> <a name="l00024"></a>00024 } <a name="l00025"></a>00025 <a name="l00026"></a>00026 <span class="preprocessor">#include <qobject.h></span> <a name="l00027"></a>00027 <span class="preprocessor">#include <qptrlist.h></span> <a name="l00028"></a>00028 <span class="preprocessor">#include <qthread.h></span> <a name="l00029"></a>00029 <span class="preprocessor">#include <qwaitcondition.h></span> <a name="l00030"></a>00030 <span class="preprocessor">#include <qmutex.h></span> <a name="l00031"></a>00031 <span class="preprocessor">#include <qevent.h></span> <a name="l00032"></a>00032 <a name="l00033"></a>00033 <span class="preprocessor">#include <kdepimmacros.h></span> <a name="l00034"></a>00034 <a name="l00035"></a>00035 <span class="keyword">namespace </span>KPIM { <a name="l00036"></a>00036 <span class="keyword">namespace </span>ThreadWeaver { <a name="l00037"></a>00037 <a name="l00054"></a>00054 KDE_EXPORT <span class="keyword">extern</span> <span class="keywordtype">bool</span> Debug; <a name="l00055"></a>00055 KDE_EXPORT <span class="keyword">extern</span> <span class="keywordtype">int</span> DebugLevel; <a name="l00056"></a>00056 <a name="l00057"></a>00057 KDE_EXPORT <span class="keyword">inline</span> <span class="keywordtype">void</span> setDebugLevel (<span class="keywordtype">bool</span> debug, <span class="keywordtype">int</span> level) <a name="l00058"></a>00058 { <a name="l00059"></a>00059 Debug = debug; <a name="l00060"></a>00060 DebugLevel = level; <a name="l00061"></a>00061 } <a name="l00062"></a>00062 <a name="l00063"></a>00063 KDE_EXPORT <span class="keyword">inline</span> <span class="keywordtype">void</span> debug(<span class="keywordtype">int</span> severity, <span class="keyword">const</span> <span class="keywordtype">char</span> * cformat, ...) <a name="l00064"></a>00064 <span class="preprocessor">#ifdef __GNUC__</span> <a name="l00065"></a>00065 <span class="preprocessor"></span> __attribute__ ( (format (printf, 2, 3 ) ) ) <a name="l00066"></a>00066 <span class="preprocessor">#endif</span> <a name="l00067"></a>00067 <span class="preprocessor"></span>; <a name="l00068"></a>00068 <a name="l00069"></a>00069 KDE_EXPORT <span class="keyword">inline</span> <span class="keywordtype">void</span> debug(<span class="keywordtype">int</span> severity, <span class="keyword">const</span> <span class="keywordtype">char</span> * cformat, ...) <a name="l00070"></a>00070 { <a name="l00071"></a>00071 <span class="keywordflow">if</span> ( Debug == <span class="keyword">true</span> && ( severity<=DebugLevel || severity == 0) ) <a name="l00072"></a>00072 { <a name="l00073"></a>00073 <span class="keyword">static</span> QMutex mutex; <a name="l00074"></a>00074 QString text; <a name="l00075"></a>00075 <a name="l00076"></a>00076 mutex.lock(); <a name="l00077"></a>00077 va_list ap; <a name="l00078"></a>00078 va_start( ap, cformat ); <a name="l00079"></a>00079 vprintf (cformat, ap); <a name="l00080"></a>00080 va_end (ap); <a name="l00081"></a>00081 mutex.unlock(); <a name="l00082"></a>00082 } <a name="l00083"></a>00083 } <a name="l00084"></a>00084 <a name="l00085"></a>00085 <a name="l00086"></a>00086 <span class="keyword">class </span>Thread; <a name="l00087"></a>00087 <span class="keyword">class </span>Job; <a name="l00088"></a>00088 <a name="l00100"></a><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Event.html">00100</a> <span class="keyword">class </span>KDE_EXPORT <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Event.html" title="A class to represent the events threads generate and send to the Weaver object.">Event</a> : <span class="keyword">public</span> QCustomEvent <a name="l00101"></a>00101 { <a name="l00102"></a>00102 <span class="keyword">public</span>: <a name="l00103"></a><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Event.html#a9901c5a6c6973f42722a32b13a3c219">00103</a> <span class="keyword">enum</span> <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Event.html#a9901c5a6c6973f42722a32b13a3c219">Action</a> { <a name="l00104"></a>00104 NoAction = 0, <a name="l00105"></a>00105 Finished, <a name="l00106"></a><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Event.html#a9901c5a6c6973f42722a32b13a3c2194a835a687797486823c64e6cfaf4c2df">00106</a> Suspended, <a name="l00107"></a><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Event.html#a9901c5a6c6973f42722a32b13a3c219603bbc02d6a89a8e7e866ef540b0eeba">00107</a> ThreadStarted, <a name="l00108"></a>00108 ThreadExiting, <a name="l00109"></a>00109 ThreadBusy, <a name="l00110"></a>00110 ThreadSuspended, <a name="l00111"></a>00111 JobStarted, <a name="l00112"></a>00112 JobFinished, <a name="l00113"></a>00113 JobSPR, <a name="l00114"></a><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Event.html#a9901c5a6c6973f42722a32b13a3c219e3af2049f9cdf149ebc5522b0b1c4a8a">00114</a> JobAPR <a name="l00115"></a>00115 }; <a name="l00116"></a>00116 <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Event.html" title="A class to represent the events threads generate and send to the Weaver object.">Event</a> ( Action = NoAction, <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Thread.html" title="The class Thread is used to represent the worker threads in the weaver&#39;s inventory...">Thread</a> * = 0, <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Job.html" title="A Job is a simple abstraction of an action that is to be executed in a thread context...">Job</a> *job = 0); <a name="l00118"></a>00118 <span class="keyword">static</span> <span class="keywordtype">int</span> type (); <a name="l00120"></a>00120 <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Thread.html" title="The class Thread is used to represent the worker threads in the weaver&#39;s inventory...">Thread</a>* thread () <span class="keyword">const</span>; <a name="l00122"></a>00122 <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Job.html" title="A Job is a simple abstraction of an action that is to be executed in a thread context...">Job</a>* job () <span class="keyword">const</span>; <a name="l00124"></a>00124 Action action () <span class="keyword">const</span>; <a name="l00125"></a>00125 <span class="keyword">private</span>: <a name="l00126"></a>00126 Action m_action; <a name="l00127"></a>00127 <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Thread.html" title="The class Thread is used to represent the worker threads in the weaver&#39;s inventory...">Thread</a> *m_thread; <a name="l00128"></a>00128 <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Job.html" title="A Job is a simple abstraction of an action that is to be executed in a thread context...">Job</a> *m_job; <a name="l00129"></a>00129 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> Type; <a name="l00130"></a>00130 }; <a name="l00131"></a>00131 <a name="l00164"></a><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Job.html">00164</a> <span class="keyword">class </span>KDE_EXPORT <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Job.html" title="A Job is a simple abstraction of an action that is to be executed in a thread context...">Job</a> : <span class="keyword">public</span> QObject <a name="l00165"></a>00165 { <a name="l00166"></a>00166 Q_OBJECT <a name="l00167"></a>00167 <span class="keyword">public</span>: <a name="l00169"></a>00169 <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Job.html" title="A Job is a simple abstraction of an action that is to be executed in a thread context...">Job</a>(QObject* parent=0, <span class="keyword">const</span> <span class="keywordtype">char</span>* name=0); <a name="l00170"></a>00170 <a name="l00172"></a>00172 <span class="keyword">virtual</span> ~<a class="code" href="classKPIM_1_1ThreadWeaver_1_1Job.html" title="A Job is a simple abstraction of an action that is to be executed in a thread context...">Job</a>(); <a name="l00173"></a>00173 <a name="l00178"></a>00178 <span class="keyword">virtual</span> <span class="keywordtype">void</span> execute(<a class="code" href="classKPIM_1_1ThreadWeaver_1_1Thread.html" title="The class Thread is used to represent the worker threads in the weaver&#39;s inventory...">Thread</a>*); <a name="l00179"></a>00179 <a name="l00181"></a>00181 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> isFinished() <span class="keyword">const</span>; <a name="l00182"></a>00182 <a name="l00184"></a>00184 <span class="keywordtype">void</span> wakeAPR (); <a name="l00185"></a>00185 <a name="l00188"></a>00188 <span class="keyword">virtual</span> <span class="keywordtype">void</span> processEvent ( <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Event.html" title="A class to represent the events threads generate and send to the Weaver object.">Event</a>* ); <a name="l00189"></a>00189 <a name="l00190"></a>00190 signals: <a name="l00192"></a>00192 <span class="keywordtype">void</span> started (); <a name="l00194"></a>00194 <span class="keywordtype">void</span> done (); <a name="l00207"></a>00207 <span class="keywordtype">void</span> SPR (); <a name="l00210"></a>00210 <span class="keywordtype">void</span> APR (); <a name="l00211"></a>00211 <span class="keyword">protected</span>: <a name="l00213"></a>00213 <span class="keywordtype">void</span> lock(); <a name="l00215"></a>00215 <span class="keywordtype">void</span> unlock(); <a name="l00219"></a>00219 <span class="keyword">virtual</span> <span class="keywordtype">void</span> run () = 0; <a name="l00222"></a>00222 <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Thread.html" title="The class Thread is used to represent the worker threads in the weaver&#39;s inventory...">Thread</a> *thread(); <a name="l00224"></a>00224 <span class="keyword">virtual</span> <span class="keywordtype">void</span> setFinished(<span class="keywordtype">bool</span> status); <a name="l00228"></a>00228 <span class="keywordtype">void</span> triggerSPR (); <a name="l00234"></a>00234 <span class="keywordtype">void</span> triggerAPR (); <a name="l00235"></a>00235 <a name="l00236"></a>00236 <span class="keywordtype">bool</span> m_finished; <a name="l00237"></a>00237 <a name="l00238"></a>00238 QMutex *m_mutex; <a name="l00239"></a>00239 <a name="l00240"></a>00240 <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Thread.html" title="The class Thread is used to represent the worker threads in the weaver&#39;s inventory...">Thread</a> * m_thread; <a name="l00241"></a>00241 <a name="l00242"></a>00242 QWaitCondition *m_wc; <a name="l00243"></a>00243 }; <a name="l00244"></a>00244 <a name="l00245"></a>00245 <span class="keyword">class </span><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Weaver.html" title="A weaver is the manager of worker threads (Thread objects) to which it assigns jobs...">Weaver</a>; <a name="l00246"></a>00246 <a name="l00249"></a><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Thread.html">00249</a> <span class="keyword">class </span>KDE_EXPORT <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Thread.html" title="The class Thread is used to represent the worker threads in the weaver&#39;s inventory...">Thread</a> : <span class="keyword">public</span> QThread <a name="l00250"></a>00250 { <a name="l00251"></a>00251 <span class="keyword">public</span>: <a name="l00255"></a>00255 <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Thread.html" title="The class Thread is used to represent the worker threads in the weaver&#39;s inventory...">Thread</a>(<a class="code" href="classKPIM_1_1ThreadWeaver_1_1Weaver.html" title="A weaver is the manager of worker threads (Thread objects) to which it assigns jobs...">Weaver</a> *parent); <a name="l00256"></a>00256 <a name="l00258"></a>00258 ~<a class="code" href="classKPIM_1_1ThreadWeaver_1_1Thread.html" title="The class Thread is used to represent the worker threads in the weaver&#39;s inventory...">Thread</a>(); <a name="l00259"></a>00259 <a name="l00269"></a>00269 <span class="keywordtype">void</span> run(); <a name="l00270"></a>00270 <a name="l00271"></a>00271 <span class="comment">/* Provide the msleep() method (protected in QThread) to be</span> <a name="l00272"></a>00272 <span class="comment"> available for executed jobs. */</span> <a name="l00273"></a>00273 <span class="keywordtype">void</span> msleep(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> msec); <a name="l00274"></a>00274 <a name="l00279"></a>00279 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> id() <span class="keyword">const</span>; <a name="l00280"></a>00280 <a name="l00282"></a>00282 <span class="keywordtype">void</span> post (<a class="code" href="classKPIM_1_1ThreadWeaver_1_1Event.html#a9901c5a6c6973f42722a32b13a3c219">Event::Action</a>, <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Job.html" title="A Job is a simple abstraction of an action that is to be executed in a thread context...">Job</a>* = 0); <a name="l00283"></a>00283 <a name="l00284"></a>00284 <span class="keyword">private</span>: <a name="l00285"></a>00285 <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Weaver.html" title="A weaver is the manager of worker threads (Thread objects) to which it assigns jobs...">Weaver</a> *m_parent; <a name="l00286"></a>00286 <a name="l00287"></a>00287 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_id; <a name="l00288"></a>00288 <a name="l00289"></a>00289 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sm_Id; <a name="l00290"></a>00290 <a name="l00291"></a>00291 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> makeId(); <a name="l00292"></a>00292 }; <a name="l00293"></a>00293 <a name="l00296"></a><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Weaver.html">00296</a> <span class="keyword">class </span>KDE_EXPORT <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Weaver.html" title="A weaver is the manager of worker threads (Thread objects) to which it assigns jobs...">Weaver</a> : <span class="keyword">public</span> QObject <a name="l00297"></a>00297 { <a name="l00298"></a>00298 Q_OBJECT <a name="l00299"></a>00299 <span class="keyword">public</span>: <a name="l00300"></a>00300 <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Weaver.html" title="A weaver is the manager of worker threads (Thread objects) to which it assigns jobs...">Weaver</a> (QObject* parent=0, <span class="keyword">const</span> <span class="keywordtype">char</span>* name=0, <a name="l00301"></a>00301 <span class="keywordtype">int</span> inventoryMin = 4, <span class="comment">// minimal number of provided threads</span> <a name="l00302"></a>00302 <span class="keywordtype">int</span> inventoryMax = 32); <span class="comment">// maximum number of provided threads</span> <a name="l00303"></a>00303 <span class="keyword">virtual</span> ~<a class="code" href="classKPIM_1_1ThreadWeaver_1_1Weaver.html" title="A weaver is the manager of worker threads (Thread objects) to which it assigns jobs...">Weaver</a> (); <a name="l00305"></a>00305 <span class="keyword">virtual</span> <span class="keywordtype">void</span> enqueue (<a class="code" href="classKPIM_1_1ThreadWeaver_1_1Job.html" title="A Job is a simple abstraction of an action that is to be executed in a thread context...">Job</a>*); <a name="l00314"></a>00314 <span class="keywordtype">void</span> enqueue (QPtrList<Job> jobs); <a name="l00324"></a>00324 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> dequeue (<a class="code" href="classKPIM_1_1ThreadWeaver_1_1Job.html" title="A Job is a simple abstraction of an action that is to be executed in a thread context...">Job</a>*); <a name="l00328"></a>00328 <span class="keyword">virtual</span> <span class="keywordtype">void</span> dequeue (); <a name="l00331"></a>00331 <span class="comment">// virtual void jobFinished(Thread *);</span> <a name="l00339"></a>00339 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> finish(); <a name="l00350"></a>00350 <span class="keyword">virtual</span> <span class="keywordtype">void</span> suspend (<span class="keywordtype">bool</span> state); <a name="l00352"></a>00352 <span class="keywordtype">bool</span> isEmpty () <span class="keyword">const</span>; <a name="l00356"></a>00356 <span class="keywordtype">bool</span> isIdle () <span class="keyword">const</span>; <a name="l00358"></a>00358 <span class="keywordtype">int</span> queueLength (); <a name="l00369"></a>00369 <span class="keyword">virtual</span> <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Job.html" title="A Job is a simple abstraction of an action that is to be executed in a thread context...">Job</a>* applyForWork (<a class="code" href="classKPIM_1_1ThreadWeaver_1_1Thread.html" title="The class Thread is used to represent the worker threads in the weaver&#39;s inventory...">Thread</a> *thread, <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Job.html" title="A Job is a simple abstraction of an action that is to be executed in a thread context...">Job</a> *previous); <a name="l00373"></a>00373 <span class="keywordtype">void</span> lock (); <a name="l00375"></a>00375 <span class="keywordtype">void</span> unlock (); <a name="l00380"></a>00380 <span class="keywordtype">void</span> post (<a class="code" href="classKPIM_1_1ThreadWeaver_1_1Event.html#a9901c5a6c6973f42722a32b13a3c219">Event::Action</a>, <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Thread.html" title="The class Thread is used to represent the worker threads in the weaver&#39;s inventory...">Thread</a>* = 0, <a class="code" href="classKPIM_1_1ThreadWeaver_1_1Job.html" title="A Job is a simple abstraction of an action that is to be executed in a thread context...">Job</a>* = 0); <a name="l00382"></a>00382 <span class="keywordtype">int</span> threads () <span class="keyword">const</span>; <a name="l00383"></a>00383 signals: <a name="l00390"></a>00390 <span class="keywordtype">void</span> finished (); <a name="l00395"></a>00395 <span class="keywordtype">void</span> suspended (); <a name="l00399"></a>00399 <span class="keywordtype">void</span> jobDone (<a class="code" href="classKPIM_1_1ThreadWeaver_1_1Job.html" title="A Job is a simple abstraction of an action that is to be executed in a thread context...">Job</a>*); <a name="l00400"></a>00400 <span class="comment">// The following signals are used mainly for debugging purposes.</span> <a name="l00401"></a>00401 <span class="keywordtype">void</span> threadCreated (<a class="code" href="classKPIM_1_1ThreadWeaver_1_1Thread.html" title="The class Thread is used to represent the worker threads in the weaver&#39;s inventory...">Thread</a> *); <a name="l00402"></a>00402 <span class="keywordtype">void</span> threadDestroyed (<a class="code" href="classKPIM_1_1ThreadWeaver_1_1Thread.html" title="The class Thread is used to represent the worker threads in the weaver&#39;s inventory...">Thread</a> *); <a name="l00403"></a>00403 <span class="keywordtype">void</span> threadBusy (<a class="code" href="classKPIM_1_1ThreadWeaver_1_1Thread.html" title="The class Thread is used to represent the worker threads in the weaver&#39;s inventory...">Thread</a> *); <a name="l00404"></a>00404 <span class="keywordtype">void</span> threadSuspended (<a class="code" href="classKPIM_1_1ThreadWeaver_1_1Thread.html" title="The class Thread is used to represent the worker threads in the weaver&#39;s inventory...">Thread</a> *); <a name="l00405"></a>00405 <a name="l00406"></a>00406 <span class="keyword">protected</span>: <a name="l00410"></a>00410 <span class="keywordtype">void</span> assignJobs(); <a name="l00413"></a>00413 <span class="keywordtype">bool</span> event ( QEvent* ); <a name="l00415"></a><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Weaver.html#af7fa53f4b80be41238831a923cfb355">00415</a> QPtrList<Thread> m_inventory; <a name="l00417"></a><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Weaver.html#7ff1159de91e03d2dde19cf453ae0b61">00417</a> QPtrList<Job> m_assignments; <a name="l00420"></a><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Weaver.html#b52ea52d66a2edd8afcb6d385741c2bd">00420</a> <span class="keywordtype">int</span> m_active; <a name="l00422"></a><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Weaver.html#77a597d8b923e8c77e1f5935e49ebfcc">00422</a> <span class="keywordtype">int</span> m_inventoryMin; <a name="l00424"></a><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Weaver.html#61ea4e6b0a4454b1cc9d2847fb8964d8">00424</a> <span class="keywordtype">int</span> m_inventoryMax; <a name="l00426"></a><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Weaver.html#8420bc62fd80965ef584ddca692e2244">00426</a> QWaitCondition m_jobAvailable; <a name="l00428"></a><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Weaver.html#66e8a94ea6dab32b8361a7a8768411eb">00428</a> QWaitCondition m_jobFinished; <a name="l00431"></a><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Weaver.html#c4e7a4f5f63c6308157f696c369750b2">00431</a> <span class="keywordtype">bool</span> m_shuttingDown; <a name="l00436"></a><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Weaver.html#46885facf2d244b1b4fa94e7ccf54174">00436</a> <span class="keywordtype">bool</span> m_running; <a name="l00441"></a><a class="code" href="classKPIM_1_1ThreadWeaver_1_1Weaver.html#45db086873432be4797d22cd339a15b1">00441</a> <span class="keywordtype">bool</span> m_suspend; <a name="l00442"></a>00442 <span class="keyword">private</span>: <a name="l00444"></a>00444 QMutex *m_mutex; <a name="l00445"></a>00445 }; <a name="l00446"></a>00446 } <span class="comment">// namespace ThreadWeaver</span> <a name="l00447"></a>00447 } <span class="comment">// namespace KPIM</span> <a name="l00448"></a>00448 <a name="l00449"></a>00449 <span class="preprocessor">#endif // defined WEAVER_H</span> </pre></div></div> </div></div> </td> </tr> <tr> <td valign="top" id="leftmenu" width="25%"> <a name="navigation"></a> <div class="menu_box"><h2>libkdepim</h2> <div class="nav_list"> <ul><li><a href="index.html">Main Page</a></li><li><a href="namespaces.html">Namespace List</a></li><li><a href="hierarchy.html">Class Hierarchy</a></li><li><a href="classes.html">Alphabetical List</a></li><li><a href="annotated.html">Class List</a></li><li><a href="files.html">File List</a></li><li><a href="namespacemembers.html">Namespace Members</a></li><li><a href="functions.html">Class Members</a></li></ul> <!-- <h2>Class Picker</h2> <div style="text-align: center;"> <form name="guideform"> <select name="guidelinks" style="width:100%;" onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value"> <option value="annotated.html">-- Choose --</option> <option value="classActionBase.html">actionbase</option>, <option value="classActionEditWidget.html">actioneditwidget</option>, <option value="classAlarmClient.html">alarmclient</option>, <option value="classConditionEditWidget.html">conditioneditwidget</option>, <option value="classGroupItem.html">groupitem</option>, <option value="classKABC_1_1ResourceNull.html">kabc::resourcenull</option>, <option value="classKConfigWizard.html">kconfigwizard</option>, <option value="classKDateEdit.html">kdateedit</option>, <option value="classKDatePickerPopup.html">kdatepickerpopup</option>, <option value="classKIncidenceChooser.html">kincidencechooser</option>, <option value="classKomposer_1_1Core.html">komposer::core</option>, <option value="classKomposer_1_1KomposerIface.html">komposer::komposeriface</option>, <option value="classKParts_1_1InfoExtension.html">kparts::infoextension</option>, <option value="classKParts_1_1SideBarExtension.html">kparts::sidebarextension</option>, <option value="classKPartsGenericPart.html">kpartsgenericpart</option>, <option value="classKPartsWidgetPlugin.html">kpartswidgetplugin</option>, <option value="classKPIM_1_1BroadcastStatus.html">kpim::broadcaststatus</option>, <option value="classKPIM_1_1ClickLineEdit.html">kpim::clicklineedit</option>, <option value="classKPIM_1_1CollectingProcess.html">kpim::collectingprocess</option>, <option value="classKPIM_1_1ConfigManager.html">kpim::configmanager</option>, <option value="classKPIM_1_1DiffAlgoDisplay.html">kpim::diffalgodisplay</option>, <option value="classKPIM_1_1DistributionList.html">kpim::distributionlist</option>, <option value="classKPIM_1_1KMailCompletion.html">kpim::kmailcompletion</option>, <option value="classKPIM_1_1KPixmapRegionSelectorDialog.html">kpim::kpixmapregionselectordialog</option>, <option value="classKPIM_1_1KPixmapRegionSelectorWidget.html">kpim::kpixmapregionselectorwidget</option>, <option value="classKPIM_1_1LdapClient.html">kpim::ldapclient</option>, <option value="classKPIM_1_1LdapObject.html">kpim::ldapobject</option>, <option value="classKPIM_1_1LdapSearch.html">kpim::ldapsearch</option>, <option value="classKPIM_1_1OverlayWidget.html">kpim::overlaywidget</option>, <option value="classKPIM_1_1PluginLoader.html">kpim::pluginloader</option>, <option value="classKPIM_1_1ProgressManager.html">kpim::progressmanager</option>, <option value="classKPIM_1_1ResourceABC.html">kpim::resourceabc</option>, <option value="classKPIM_1_1SelectionItem.html">kpim::selectionitem</option>, <option value="classKPIM_1_1ThreadWeaver_1_1Event.html">kpim::threadweaver::event</option>, <option value="classKPIM_1_1ThreadWeaver_1_1Job.html">kpim::threadweaver::job</option>, <option value="classKPIM_1_1ThreadWeaver_1_1Thread.html">kpim::threadweaver::thread</option>, <option value="classKPIM_1_1ThreadWeaver_1_1Weaver.html">kpim::threadweaver::weaver</option>, <option value="classKPIM_1_1ThreadWeaver_1_1WeaverExtension.html">kpim::threadweaver::weaverextension</option>, <option value="classKPIM_1_1ThreadWeaver_1_1WeaverThreadLogger.html">kpim::threadweaver::weaverthreadlogger</option>, <option value="classKPrefsDialog.html">kprefsdialog</option>, <option value="classKPrefsWid.html">kprefswid</option>, <option value="classKPrefsWidBool.html">kprefswidbool</option>, <option value="classKPrefsWidColor.html">kprefswidcolor</option>, <option value="classKPrefsWidCombo.html">kprefswidcombo</option>, <option value="classKPrefsWidDate.html">kprefswiddate</option>, <option value="classKPrefsWidDuration.html">kprefswidduration</option>, <option value="classKPrefsWidFont.html">kprefswidfont</option>, <option value="classKPrefsWidInt.html">kprefswidint</option>, <option value="classKPrefsWidManager.html">kprefswidmanager</option>, <option value="classKPrefsWidPath.html">kprefswidpath</option>, <option value="classKPrefsWidRadios.html">kprefswidradios</option>, <option value="classKPrefsWidString.html">kprefswidstring</option>, <option value="classKPrefsWidTime.html">kprefswidtime</option>, <option value="classKRecentAddress_1_1RecentAddresses.html">krecentaddress::recentaddresses</option>, <option value="classKRegExp3.html">kregexp3</option>, <option value="classKResourcePrefs.html">kresourceprefs</option>, <option value="classKRSqueezedTextLabel.html">krsqueezedtextlabel</option>, <option value="classKSubscription.html">ksubscription</option>, <option value="classKTimeEdit.html">ktimeedit</option>, <option value="classKVCardDrag.html">kvcarddrag</option>, <option value="classKWidgetLister.html">kwidgetlister</option>, <option value="classLinkLocator.html">linklocator</option>, <option value="classQStrictUtf7Codec.html">qstrictutf7codec</option>, <option value="classQUtf7Codec.html">qutf7codec</option>, <option value="classRuleEditWidget.html">ruleeditwidget</option>, <option value="classRuleListWidget.html">rulelistwidget</option>, <option value="classRuleStack.html">rulestack</option>, <option value="classScorableGroup.html">scorablegroup</option>, <option value="classSingleActionWidget.html">singleactionwidget</option>, <option value="classSingleConditionWidget.html">singleconditionwidget</option>, </select> </form> </div> --> </div></div> <div class="menu_box"><h2>API Dox</h2> <div class="nav_list"> <ul> <li><a href="../../akregator/html/index.html">akregator</a></li><li> <a href="../../akregator/src/html/index.html">src</a></li><li> <a href="../../akregator/src/librss/html/index.html">librss</a></li><li><a href="../../certmanager/html/index.html">certmanager</a></li><li> <a href="../../certmanager/lib/html/index.html">lib</a></li><li><a href="../../kaddressbook/html/index.html">kaddressbook</a></li><li><a href="../../kalarm/html/index.html">kalarm</a></li><li> <a href="../../kalarm/lib/html/index.html">lib</a></li><li><a href="../../kandy/html/index.html">kandy</a></li><li><a href="../../karm/html/index.html">karm</a></li><li><a href="../../kdgantt/html/index.html">kdgantt</a></li><li><a href="../../kgantt/html/index.html">kgantt</a></li><li><a href="../../kioslaves/html/index.html">kioslaves</a></li><li> <a href="../../kioslaves/imap4/html/index.html">imap4</a></li><li> <a href="../../kioslaves/mbox/html/index.html">mbox</a></li><li><a href="../../kitchensync/html/index.html">kitchensync</a></li><li><a href="../../kmail/html/index.html">kmail</a></li><li><a href="../../knotes/html/index.html">knotes</a></li><li><a href="../../konsolekalendar/html/index.html">konsolekalendar</a></li><li><a href="../../kontact/html/index.html">kontact</a></li><li><a href="../../korganizer/html/index.html">korganizer</a></li><li><a href="../../kpilot/html/index.html">kpilot</a></li><li> <a href="../../kpilot/kpilot/html/index.html">kpilot</a></li><li> <a href="../../kpilot/lib/html/index.html">lib</a></li><li><a href="../../libemailfunctions/html/index.html">libemailfunctions</a></li><li><a href="../../libkcal/html/index.html">libkcal</a></li><li><a href="../../libkdepim/html/index.html">libkdepim</a></li><li><a href="../../libkholidays/html/index.html">libkholidays</a></li><li><a href="../../libkmime/html/index.html">libkmime</a></li><li><a href="../../libkpgp/html/index.html">libkpgp</a></li><li><a href="../../libkpimidentities/html/index.html">libkpimidentities</a></li> </ul></div></div> </td> </tr> </table> <span class="doNotDisplay"> <a href="http://www.kde.org/" accesskey="8">KDE Home</a> | <a href="http://accessibility.kde.org/" accesskey="9">KDE Accessibility Home</a> | <a href="http://www.kde.org/media/accesskeys.php" accesskey="0">Description of Access Keys</a> </span> <div style="height: 8px"></div> <div id="footer"> <div id="footer_left"> Maintained by <a href="mailto:groot@kde.org">Adriaan de Groot</a> and <a href="mailto:winter@kde.org">Allen Winter</a>. <br/> KDE and K Desktop Environment are trademarks of <a href="http://www.kde.org/areas/kde-ev/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> | <a href="http://www.kde.org/contact/impressum.php">Legal</a> </div> <div id="footer_right"><img src="/media/images/footer_right.png" style="margin: 0px" alt="" /></div> </div> <!-- WARNING: DO NOT SEND MAIL TO THE FOLLOWING EMAIL ADDRESS! YOU WILL BE BLOCKED INSTANTLY AND PERMANENTLY! <a href="mailto:aaaatrap-425acc3b5374943f@kde.org">Block me</a> WARNING END --> </body> </html>