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 TGo4Runnable_H 00017 #define TGo4Runnable_H 00018 00019 #include "TNamed.h" 00020 #include "Go4Exceptions/Go4Exceptions.h" 00021 00022 class TGo4Thread; 00023 class TGo4ThreadManager; 00024 00035 class TGo4Runnable : public TNamed { 00036 friend class TGo4Thread; 00037 00038 public: 00039 TGo4Runnable(const TGo4Runnable &right); 00040 00041 TGo4Runnable (const char* name, TGo4ThreadManager* man); 00042 00043 virtual ~TGo4Runnable(); 00044 00045 TGo4Runnable & operator=(const TGo4Runnable &right); 00046 00047 void SetThread (TGo4Thread* gthread) 00048 { 00049 fxGo4Thread=gthread; 00050 } 00051 00052 TGo4Thread* GetThread () 00053 { 00054 return fxGo4Thread; 00055 } 00056 00057 TGo4ThreadManager* GetThreadManager () 00058 { 00059 return fxManager; 00060 } 00061 00062 00063 protected: 00064 00068 virtual Int_t Run (void* ptr) = 0; 00069 00073 virtual Int_t PreRun (void* ptr); 00074 00078 virtual Int_t PostRun (void* ptr); 00079 00083 virtual void ThreadCatch (TGo4Exception& ex); 00084 00088 virtual void UnexpectedCatch (); 00089 00095 TGo4ThreadManager *fxManager; 00096 00102 TGo4Thread *fxGo4Thread; 00103 00104 private: 00105 TGo4Runnable(); 00106 }; 00107 00108 #endif 00109 00110 //----------------------------END OF GO4 SOURCE FILE ---------------------