GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4ThreadManager.h
Go to the documentation of this file.
1 // $Id: TGo4ThreadManager.h 2627 2019-10-01 08:02:45Z 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 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 TGo4ThreadManager_H
15 #define TGo4ThreadManager_H
16 
17 #include "TNamed.h"
18 
19 class TGo4ThreadHandler;
21 
30 class TGo4ThreadManager : public TNamed {
31 
32  public:
34 
39  TGo4ThreadManager (const char* name, Bool_t blockingmode = kTRUE, Bool_t autostart = kTRUE, Bool_t autocreate = kTRUE);
40 
41  virtual ~TGo4ThreadManager();
42 
45  void SetTimer(TGo4AppControlTimer* ctrltimer) { fxBlocker=ctrltimer; }
46 
49 
51  Bool_t BlockApp();
52 
59  Bool_t UnBlockApp(Int_t mode = 0);
60 
61  virtual Int_t Initialization();
62 
63  Bool_t IsInitDone() const { return fbInitDone; }
64 
66  Bool_t IsTerminating () const { return fbTerminating; }
67 
68  Bool_t IsTerminateApp() const { return fbTerminateApplication; }
69 
71  Bool_t IsAppBlocking() const { return fbAppBlocking; }
72 
73 
75  Bool_t IsBeingQuit() const { return fbBeingQuit; }
76 
77  void SetBeingQuit(Bool_t on) {fbBeingQuit=on;}
78 
79 
85  void Launch ();
86 
90  virtual void Terminate (Bool_t termapp=kTRUE);
91 
93  virtual void TerminateFast();
94 
96  static const Long_t fglTIMERPERIOD;
97 
99  enum { fguTEXTLENGTH = 256 };
100 
101  protected:
102 
104  Bool_t fbInitDone;
105 
108 
112 
117 
120  Bool_t fbAutoCreate;
121 
125  Bool_t fbAutoStart;
126 
127  /* flag that can be set at begin of application quit sequence.
128  * Can be optionally used by application to implement a quit timeout
129  * that will terminate if regular shutdown hangs up*/
130  Int_t fbBeingQuit;
131 
137 
143 
144  private:
146 
147  ClassDef(TGo4ThreadManager,1)
148 };
149 
150 #endif
virtual Int_t Initialization()
virtual void TerminateFast()
Bool_t IsAppBlocking() const
TGo4ThreadHandler * fxWorkHandler
TGo4AppControlTimer * fxBlocker
Bool_t IsBeingQuit() const
Bool_t UnBlockApp(Int_t mode=0)
Bool_t IsTerminateApp() const
void SetTimer(TGo4AppControlTimer *ctrltimer)
TGo4ThreadHandler * GetWorkHandler() const
Bool_t IsInitDone() const
void SetBeingQuit(Bool_t on)
Bool_t IsTerminating() const
virtual void Terminate(Bool_t termapp=kTRUE)
static const Long_t fglTIMERPERIOD