Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4TaskHandler/TGo4TaskManager.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE 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 TGO4TASKMANAGER_H
00017 #define TGO4TASKMANAGER_H
00018 
00019 #include "TNamed.h"
00020 #include "Go4CommandsBase/TGo4Command.h"
00021 
00022 class TObjArray;
00023 class TMutex;
00024 class TGo4ServerTask;
00025 class TGo4Socket;
00026 class TGo4TaskHandler;
00027 
00028 class TGo4TaskManager : public TNamed {
00029    public:
00030 
00031       TGo4TaskManager(const char* name, TGo4ServerTask * server, UInt_t negotiationport=0);
00032 
00033       virtual ~TGo4TaskManager();
00034 
00038       Int_t ServeClient();
00039 
00044       Go4CommandMode_t ClientLogin();  
00045 
00051       Int_t ConnectClient(const char* client, const char* host, Go4CommandMode_t role=kGo4ComModeController);
00052 
00057       Int_t DisConnectClient(const char* name , Bool_t clientwait=kTRUE);
00058 
00063       Int_t DisConnectClient(TGo4TaskHandler * taskhandler, Bool_t clientwait=kTRUE);
00064 
00069       Bool_t AddClient(const char* client, const char* host, Go4CommandMode_t role);
00070 
00074       Bool_t AddTaskHandler(TGo4TaskHandler* han);
00075 
00079       TGo4TaskHandler* NewTaskHandler(const char* name);
00080 
00084       Bool_t RemoveTaskHandler(const char* name);
00085 
00089       TGo4TaskHandler* GetTaskHandler(const char* name);
00090 
00094       TGo4TaskHandler* GetLastTaskHandler();
00095 
00102       TGo4TaskHandler* NextTaskHandler(Bool_t reset=kFALSE);
00103 
00104       TMutex* GetMutex(){return fxListMutex;}  
00105 
00107       UInt_t GetTaskCount() const { return fuTaskCount; }
00108 
00114       UInt_t GetNegotiationPort();
00115 
00116 
00117      Int_t WaitForClientRemoved();
00118 
00119      Bool_t HasControllerTask(){return fbHasControllerConnection;}
00120     
00124       static const Int_t fgiDISCONCYCLES;
00125 
00129       static const UInt_t fguDISCONTIME;
00130    private:
00131       // do not use this ctors and assignment operators:
00132 
00133       TGo4TaskManager();
00134 
00135       TGo4TaskManager(const TGo4TaskManager &right);
00136 
00137       TGo4TaskManager & operator=(const TGo4TaskManager &right);
00138 
00139       // private members:
00140 
00141       TGo4ServerTask* fxServer; 
00142 
00143       TGo4Socket* fxTransport; 
00144 
00147       TObjArray* fxTaskList;    
00148 
00149       TMutex* fxListMutex;      
00150 
00152       TIterator* fxTaskIter; 
00153 
00159       /*#  TGo4TaskHandler lnkTGo4TaskHandler1; */
00160       UInt_t fuTaskCount;
00161 
00165       UInt_t fuNegotiationPort;
00166 
00172       Bool_t fbClientIsRemoved;
00173       
00177       Bool_t fbHasControllerConnection;
00178 };
00179 
00180 #endif //TGO4TASKMANAGER_H
00181 
00182 
00183 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:56:06 2005 for Go4-v2.10-5 by doxygen1.2.15