CrystalSpace

Public API Reference

iutil/job.h
Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2005 by Jorrit Tyberghein
00003               (C) 2005 by Frank Richter
00004               (C) 2009 by Marten Svanfeldt
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public
00017     License along with this library; if not, write to the Free
00018     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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__

Generated for Crystal Space 2.0 by doxygen 1.7.6.1