GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4TaskManager.h
Go to the documentation of this file.
1 // $Id: TGo4TaskManager.h 478 2009-10-29 12:26:09Z 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 TGO4TASKMANAGER_H
15 #define TGO4TASKMANAGER_H
16 
17 #include "TNamed.h"
18 #include "TGo4Command.h"
19 
20 class TObjArray;
21 class TMutex;
22 class TGo4ServerTask;
23 class TGo4Socket;
24 class TGo4TaskHandler;
25 class TIterator;
26 
27 class TGo4TaskManager : public TNamed {
28  public:
29 
30  TGo4TaskManager(const char* name, TGo4ServerTask * server, UInt_t negotiationport=0, Bool_t createconnector=kTRUE);
31 
32  virtual ~TGo4TaskManager();
33 
37  Int_t ServeClient();
38 
44 
50  Int_t ConnectClient(const char* client, const char* host, Go4CommandMode_t role=kGo4ComModeController);
51 
56  Int_t DisConnectClient(const char* name , Bool_t clientwait=kTRUE);
57 
62  Int_t DisConnectClient(TGo4TaskHandler * taskhandler, Bool_t clientwait=kTRUE);
63 
68  Bool_t AddClient(const char* client, const char* host, Go4CommandMode_t role);
69 
73  Bool_t AddTaskHandler(TGo4TaskHandler* han);
74 
78  TGo4TaskHandler* NewTaskHandler(const char* name);
79 
83  Bool_t RemoveTaskHandler(const char* name);
84 
88  TGo4TaskHandler* GetTaskHandler(const char* name);
89 
94 
101  TGo4TaskHandler* NextTaskHandler(Bool_t reset=kFALSE);
102 
103  TMutex* GetMutex(){return fxListMutex;}
104 
106  UInt_t GetTaskCount() const { return fuTaskCount; }
107 
113  UInt_t GetNegotiationPort();
114 
115 
116  Int_t WaitForClientRemoved();
117 
119 
123  static const Int_t fgiDISCONCYCLES;
124 
128  static const UInt_t fguDISCONTIME;
129  private:
130  // do not use this ctors and assignment operators:
131 
132  TGo4TaskManager();
133 
134  TGo4TaskManager(const TGo4TaskManager &right);
135 
136  // private members:
137 
139 
141 
144  TObjArray* fxTaskList;
145 
146  TMutex* fxListMutex;
147 
149  TIterator* fxTaskIter;
150 
156  /*# TGo4TaskHandler lnkTGo4TaskHandler1; */
157  UInt_t fuTaskCount;
158 
163 
170 
175 };
176 
177 #endif //TGO4TASKMANAGER_H
178 
Bool_t AddTaskHandler(TGo4TaskHandler *han)
Bool_t HasControllerTask()
virtual ~TGo4TaskManager()
TGo4TaskHandler * NextTaskHandler(Bool_t reset=kFALSE)
Int_t ConnectClient(const char *client, const char *host, Go4CommandMode_t role=kGo4ComModeController)
Go4CommandMode_t
Definition: TGo4Command.h:28
UInt_t GetNegotiationPort()
Bool_t fbHasControllerConnection
TGo4ServerTask * fxServer
Go4CommandMode_t ClientLogin()
static const UInt_t fguDISCONTIME
Bool_t RemoveTaskHandler(const char *name)
TIterator * fxTaskIter
Int_t DisConnectClient(const char *name, Bool_t clientwait=kTRUE)
UInt_t GetTaskCount() const
TGo4TaskHandler * GetTaskHandler(const char *name)
TMutex * GetMutex()
Bool_t AddClient(const char *client, const char *host, Go4CommandMode_t role)
static const Int_t fgiDISCONCYCLES
TGo4Socket * fxTransport
TObjArray * fxTaskList
TGo4TaskHandler * GetLastTaskHandler()
Int_t WaitForClientRemoved()
TGo4TaskHandler * NewTaskHandler(const char *name)