ThreadWeaver
JobCollection.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef JOBCOLLECTION_H
00030 #define JOBCOLLECTION_H
00031
00032 #include "Job.h"
00033
00034 namespace ThreadWeaver {
00035
00036 class Thread;
00037 class JobCollectionJobRunner;
00038
00049 class THREADWEAVER_EXPORT JobCollection : public Job
00050 {
00051 friend class JobCollectionJobRunner;
00052 Q_OBJECT
00053
00054 public:
00055 explicit JobCollection ( QObject *parent = 0 );
00056 ~JobCollection ();
00063 virtual void addJob ( Job* );
00064
00066 bool canBeExecuted();
00067
00068 public Q_SLOTS:
00072 void stop ( ThreadWeaver::Job *job );
00073
00074 protected:
00076 void aboutToBeQueued ( WeaverInterface *weaver );
00077
00079 void aboutToBeDequeued ( WeaverInterface *weaver );
00080
00082 Job* jobAt( int i );
00083
00085 const int jobListLength();
00086
00089 virtual void internalJobDone( Job* );
00090
00096 void finalCleanup();
00097
00098 private Q_SLOTS:
00099
00100
00101 void jobRunnerDone();
00102
00103 private:
00105 void execute ( Thread * );
00106
00109 void run() {}
00110
00114 void dequeueElements();
00115
00116 class Private;
00117 Private * const d;
00118
00119 };
00120
00121 }
00122
00123 #endif