00001 //------------------------------------------------------------- 00002 // Go4 Release Package v3.04-01 (build 30401) 00003 // 28-November-2008 00004 //--------------------------------------------------------------- 00005 // The GSI Online Offline Object Oriented (Go4) Project 00006 // Experiment Data Processing at EE 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 00021 #include "TGo4Exception.h" 00022 00023 class TGo4Thread; 00024 class TGo4ThreadManager; 00025 00036 class TGo4Runnable : public TNamed { 00037 friend class TGo4Thread; 00038 00039 public: 00040 TGo4Runnable(const TGo4Runnable &right); 00041 00042 TGo4Runnable (const char* name, TGo4ThreadManager* man); 00043 00044 virtual ~TGo4Runnable(); 00045 00046 void SetThread (TGo4Thread* gthread) { fxGo4Thread=gthread; } 00047 00048 TGo4Thread* GetThread() const { return fxGo4Thread; } 00049 00050 TGo4ThreadManager* GetThreadManager() const { return fxManager; } 00051 00052 protected: 00053 00054 TGo4Runnable(); 00055 00057 virtual Int_t Run (void* ptr) = 0; 00058 00060 virtual Int_t PreRun (void* ptr); 00061 00063 virtual Int_t PostRun (void* ptr); 00064 00066 virtual void ThreadCatch(TGo4Exception& ex); 00067 00069 virtual void UnexpectedCatch (); 00070 00074 TGo4ThreadManager *fxManager; 00075 00079 TGo4Thread *fxGo4Thread; 00080 }; 00081 00082 #endif 00083 00084 //----------------------------END OF GO4 SOURCE FILE ---------------------