Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4TaskManager.h

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE 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 "TGo4Command.h"
00021 
00022 class TObjArray;
00023 class TMutex;
00024 class TGo4ServerTask;
00025 class TGo4Socket;
00026 class TGo4TaskHandler;
00027 class TIterator;
00028 
00029 class TGo4TaskManager : public TNamed {
00030    public:
00031 
00032       TGo4TaskManager(const char* name, TGo4ServerTask * server, UInt_t negotiationport=0, Bool_t createconnector=kTRUE);
00033 
00034       virtual ~TGo4TaskManager();
00035 
00039       Int_t ServeClient();
00040 
00045       Go4CommandMode_t ClientLogin();
00046 
00052       Int_t ConnectClient(const char* client, const char* host, Go4CommandMode_t role=kGo4ComModeController);
00053 
00058       Int_t DisConnectClient(const char* name , Bool_t clientwait=kTRUE);
00059 
00064       Int_t DisConnectClient(TGo4TaskHandler * taskhandler, Bool_t clientwait=kTRUE);
00065 
00070       Bool_t AddClient(const char* client, const char* host, Go4CommandMode_t role);
00071 
00075       Bool_t AddTaskHandler(TGo4TaskHandler* han);
00076 
00080       TGo4TaskHandler* NewTaskHandler(const char* name);
00081 
00085       Bool_t RemoveTaskHandler(const char* name);
00086 
00090       TGo4TaskHandler* GetTaskHandler(const char* name);
00091 
00095       TGo4TaskHandler* GetLastTaskHandler();
00096 
00103       TGo4TaskHandler* NextTaskHandler(Bool_t reset=kFALSE);
00104 
00105       TMutex* GetMutex(){return fxListMutex;}
00106 
00108       UInt_t GetTaskCount() const { return fuTaskCount; }
00109 
00115       UInt_t GetNegotiationPort();
00116 
00117 
00118      Int_t WaitForClientRemoved();
00119 
00120      Bool_t HasControllerTask(){return fbHasControllerConnection;}
00121 
00125       static const Int_t fgiDISCONCYCLES;
00126 
00130       static const UInt_t fguDISCONTIME;
00131    private:
00132       // do not use this ctors and assignment operators:
00133 
00134       TGo4TaskManager();
00135 
00136       TGo4TaskManager(const TGo4TaskManager &right);
00137 
00138       // private members:
00139 
00140       TGo4ServerTask* fxServer; 
00141 
00142       TGo4Socket* fxTransport; 
00143 
00146       TObjArray* fxTaskList;    
00147 
00148       TMutex* fxListMutex;      
00149 
00151       TIterator* fxTaskIter; 
00152 
00158       /*#  TGo4TaskHandler lnkTGo4TaskHandler1; */
00159       UInt_t fuTaskCount;
00160 
00164       UInt_t fuNegotiationPort;
00165 
00171       Bool_t fbClientIsRemoved;
00172 
00176       Bool_t fbHasControllerConnection;
00177 };
00178 
00179 #endif //TGO4TASKMANAGER_H
00180 
00181 
00182 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:30 2008 for Go4-v3.04-1 by  doxygen 1.4.2