GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4Runnable.h
Go to the documentation of this file.
1 // $Id: TGo4Runnable.h 1196 2014-04-10 14:06:24Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #ifndef TGo4Runnable_H
15 #define TGo4Runnable_H
16 
17 #include "TNamed.h"
18 
19 #include "TGo4Exception.h"
20 
21 class TGo4Thread;
22 class TGo4ThreadManager;
23 
33 class TGo4Runnable : public TNamed {
34  friend class TGo4Thread;
35 
36  public:
37  TGo4Runnable(const TGo4Runnable &right);
38 
39  TGo4Runnable (const char* name, TGo4ThreadManager* man);
40 
41  virtual ~TGo4Runnable();
42 
43  void SetThread (TGo4Thread* gthread) { fxGo4Thread=gthread; }
44 
45  TGo4Thread* GetThread() const { return fxGo4Thread; }
46 
48 
49  protected:
50 
51  TGo4Runnable();
52 
54  virtual Int_t Run (void* ptr) = 0;
55 
57  virtual Int_t PreRun (void* ptr);
58 
60  virtual Int_t PostRun (void* ptr);
61 
63  virtual void ThreadCatch(TGo4Exception& ex);
64 
66  virtual void UnexpectedCatch ();
67 
72 
77 };
78 
79 #endif
virtual void ThreadCatch(TGo4Exception &ex)
TGo4ThreadManager * fxManager
Definition: TGo4Runnable.h:71
TGo4Thread * fxGo4Thread
Definition: TGo4Runnable.h:76
virtual ~TGo4Runnable()
TGo4Thread * GetThread() const
Definition: TGo4Runnable.h:45
virtual void UnexpectedCatch()
virtual Int_t PreRun(void *ptr)
void SetThread(TGo4Thread *gthread)
Definition: TGo4Runnable.h:43
TGo4ThreadManager * GetThreadManager() const
Definition: TGo4Runnable.h:47
virtual Int_t Run(void *ptr)=0
virtual Int_t PostRun(void *ptr)