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 #ifndef __CS_IUTIL_JOB_H__
00022 #define __CS_IUTIL_JOB_H__
00023
00029 #include "csutil/scf_interface.h"
00030
00031
00036 struct iJob : public virtual iBase
00037 {
00038 SCF_INTERFACE(iJob, 2,0,0);
00040 virtual void Run() = 0;
00041 };
00042
00053 struct iJobQueue : public virtual iBase
00054 {
00055 SCF_INTERFACE(iJobQueue,4,1,0);
00056
00058 virtual void Enqueue (iJob* job) = 0;
00059
00063 enum JobStatus
00064 {
00066 NotEnqueued,
00068 Pending,
00073 Dequeued
00074 };
00075
00084 virtual JobStatus Dequeue (iJob* job, bool waitForCompletion = false) = 0;
00085
00095 virtual JobStatus PullAndRun (iJob* job, bool waitForCompletion = true) = 0;
00096
00103 virtual void WaitAll () = 0;
00104
00111 virtual bool IsFinished () = 0;
00112
00116 virtual int32 GetQueueCount() = 0;
00117
00118
00119 };
00120
00121 #endif // __CS_IUTIL_JOB_H__