GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4Runnable.h
Go to the documentation of this file.
1// $Id$
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 fuer 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
19class TGo4Thread;
21class TGo4Exception;
22
33
34class TGo4Runnable : public TNamed {
35 friend class TGo4Thread;
36
37 public:
38 TGo4Runnable(const TGo4Runnable &right);
39
40 TGo4Runnable (const char *name, TGo4ThreadManager *man);
41
42 virtual ~TGo4Runnable();
43
44 void SetThread (TGo4Thread *gthread) { fxGo4Thread = gthread; }
45
46 TGo4Thread *GetThread() const { return fxGo4Thread; }
47
49
50 protected:
51
53
55 virtual Int_t Run(void *ptr) = 0;
56
58 virtual Int_t PreRun(void *ptr);
59
61 virtual Int_t PostRun(void *ptr);
62
64 virtual void ThreadCatch(TGo4Exception &ex);
65
67 virtual void UnexpectedCatch();
68
73
78};
79
80#endif
TGo4Runnable(const TGo4Runnable &right)
TGo4Thread * GetThread() const
virtual ~TGo4Runnable()
void SetThread(TGo4Thread *gthread)
virtual void ThreadCatch(TGo4Exception &ex)
catch for exceptions occurring in workfunc
friend class TGo4Thread
virtual Int_t PostRun(void *ptr)
Function which is called once after the Run()method on threadstop.
virtual Int_t Run(void *ptr)=0
The working function which runs in the thread.
virtual void UnexpectedCatch()
catch for all unexpected exceptions happening in workfunc
TGo4ThreadManager * fxManager
The threadmanager which is responsible for our thread.
TGo4ThreadManager * GetThreadManager() const
TGo4Thread * fxGo4Thread
Backlink to thread which runs this.
virtual Int_t PreRun(void *ptr)
Function which is called once before the Run() method on threadstart.
Go4 thread manager.
go4 thread class
Definition TGo4Thread.h:34