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
00084 #ifdef __GNUC__
00085 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 1)
00086 #pragma GCC diagnostic ignored "-Wignored-qualifiers"
00087 #endif
00088 #endif
00089
00090 const int jobListLength();
00091
00094 virtual void internalJobDone( Job* );
00095
00101 void finalCleanup();
00102
00103 private Q_SLOTS:
00104
00105
00106 void jobRunnerDone();
00107
00108 private:
00110 void execute ( Thread * );
00111
00114 void run() {}
00115
00119 void dequeueElements();
00120
00121 class Private;
00122 Private * const d;
00123
00124 };
00125
00126 }
00127
00128 #endif