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
00046 class THREADWEAVER_EXPORT JobCollection : public Job
00047 {
00048 friend class JobCollectionJobRunner;
00049 Q_OBJECT
00050
00051 public:
00052 explicit JobCollection ( QObject *parent = 0 );
00053 ~JobCollection ();
00060 virtual void addJob ( Job* );
00061
00063 bool canBeExecuted();
00064
00065 public Q_SLOTS:
00069 void stop ( ThreadWeaver::Job *job );
00070
00071 protected:
00073 void aboutToBeQueued ( WeaverInterface *weaver );
00074
00076 void aboutToBeDequeued ( WeaverInterface *weaver );
00077
00079 Job* jobAt( int i );
00080
00082 const int jobListLength();
00083
00086 virtual void internalJobDone( Job* );
00087
00092 void finalCleanup();
00093
00094 private:
00096 void execute ( Thread * );
00097
00100 void run() {}
00101
00105 void dequeueElements();
00106
00107 class Private;
00108 Private * const d;
00109
00110 };
00111
00112 }
00113
00114 #endif