00001 //--------------------------------------------------------------- 00002 // Go4 Release Package v2.10-5 (build 21005) 00003 // 03-Nov-2005 00004 //--------------------------------------------------------------- 00005 // The GSI Online Offline Object Oriented (Go4) Project 00006 // Experiment Data Processing at DVEE department, GSI 00007 //--------------------------------------------------------------- 00008 // 00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI 00010 // Planckstr. 1, 64291 Darmstadt, Germany 00011 //Contact: http://go4.gsi.de 00012 //---------------------------------------------------------------- 00013 //This software can be used under the license agreements as stated 00014 //in Go4License.txt file which is part of the distribution. 00015 //---------------------------------------------------------------- 00016 #ifndef TGo4ThreadManager_H 00017 #define TGo4ThreadManager_H 00018 00019 #include "TNamed.h" 00020 #include "TGo4AppControlTimer.h" 00021 #include "TGo4ThreadHandler.h" 00022 00034 class TGo4ThreadManager : public TNamed { 00035 00036 public: 00037 TGo4ThreadManager(const TGo4ThreadManager &right); 00038 00045 TGo4ThreadManager (const char* name, Bool_t blockingmode = kTRUE, Bool_t autostart = kTRUE, Bool_t autocreate = kTRUE); 00046 00047 virtual ~TGo4ThreadManager(); 00048 00049 TGo4ThreadManager & operator=(const TGo4ThreadManager &right); 00050 00055 void SetTimer (TGo4AppControlTimer* ctrltimer) 00056 { 00057 fxBlocker=ctrltimer; 00058 } 00059 00063 TGo4ThreadHandler* GetWorkHandler () 00064 { 00065 return fxWorkHandler; 00066 } 00067 00071 Bool_t BlockApp (); 00072 00081 Bool_t UnBlockApp (Int_t mode = 0); 00082 00083 virtual Int_t Initialization (); 00084 00085 Bool_t IsInitDone () const 00086 { 00087 return fbInitDone; 00088 } 00089 00093 Bool_t IsTerminating () const 00094 { 00095 return fbTerminating; 00096 } 00097 00098 Bool_t IsTerminateApp() const 00099 { 00100 return fbTerminateApplication; 00101 } 00102 00106 Bool_t IsAppBlocking () 00107 { 00108 return fbAppBlocking; 00109 } 00110 00118 void Launch (); 00119 00125 virtual void Terminate (Bool_t termapp=kTRUE); 00126 00127 00131 virtual void TerminateFast (); 00132 00133 00137 static const Long_t fglTIMERPERIOD; 00138 00142 static const UInt_t fguTEXTLENGTH; 00143 00144 protected: 00148 Bool_t fbInitDone; 00149 00153 Bool_t fbTerminating; 00154 00159 Bool_t fbTerminateApplication; 00160 00166 Bool_t fbAppBlocking; 00167 00172 Bool_t fbAutoCreate; 00173 00179 Bool_t fbAutoStart; 00180 00187 TGo4AppControlTimer *fxBlocker; 00188 00195 TGo4ThreadHandler *fxWorkHandler; 00196 00197 private: 00198 TGo4ThreadManager(); 00199 00200 ClassDef(TGo4ThreadManager,1) 00201 }; 00202 00203 #endif 00204 00205 //----------------------------END OF GO4 SOURCE FILE ---------------------