00001 // $Id: TGo4HistogramServer.h 478 2009-10-29 12:26:09Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #ifndef TGO4HISTOGRAMSERVER_H 00015 #define TGO4HISTOGRAMSERVER_H 00016 00017 #include "TGo4CommandReceiver.h" 00018 #include "TString.h" 00019 00020 class TGo4AnalysisClient; 00021 class TGo4Analysis; 00022 class TGo4ThreadHandler; 00023 class TGo4ObjConnectorTimer; 00024 class TGo4Socket; 00025 00035 class TGo4HistogramServer : public TGo4CommandReceiver { 00036 00037 friend class TGo4HisConnectorRunnable; 00038 00039 public: 00040 00041 virtual ~TGo4HistogramServer(); 00042 00043 TGo4HistogramServer(TGo4AnalysisClient* owner, 00044 const char* servername="localhost", 00045 const char* password="go4", 00046 Bool_t useobjectserver=kFALSE); 00047 00048 TGo4HistogramServer(); 00049 00051 Int_t ServeObjectClient(); 00052 00054 UInt_t GetObjPort(); 00055 00059 virtual Int_t TimerConnect(); 00060 00061 TGo4AnalysisClient* GetAnalysisClient() const { return fxAnalysisClient; } 00062 00063 TGo4Analysis* GetAnalysis() const { return fxAnalysis; } 00064 00066 static const char* fgcCONTHREADNAME; 00067 00069 static const char* fgcOBJTHREADNAME; 00070 00072 static const char* fgcSHUTDOWNNAME; 00073 00075 static const char* fgcCOMGETLIST; 00076 00078 static const UInt_t fguTIMERPERIOD; 00079 00081 static const Int_t fgiOPENWAITCYCLES; 00082 00084 static const UInt_t fguOPENWAITCYCLETIME; 00085 00087 static const Int_t fgiCLOSEWAITCYCLES; 00088 00090 static const UInt_t fguCLOSEWAITCYCLETIME; 00091 00093 static const Int_t fgiCONNECTWAITCYCLES; 00094 00096 static const UInt_t fguCONNECTWAITCYCLETIME; 00097 00098 private: 00099 00100 const char* ConnectorName() const { return fxConnectorName.Data(); } 00101 00102 const char* ObjectThreadName() const { return fxObjectThreadName.Data(); } 00103 00104 const char* ConnectHost() const { return fcConnectHost.Data(); } 00105 00106 void SetConnect(TGo4Socket * trans, const char* host, UInt_t port); 00107 00108 void SetDisConnect(TGo4Socket * trans); 00109 00110 Int_t WaitForOpen(); 00111 00112 Int_t WaitForClose(); 00113 00114 Int_t WaitForConnection(); 00115 00117 void DisconnectObjectClient(); 00118 00120 Bool_t CheckLogin(); 00121 00123 Int_t ConnectObjectClient(); 00124 00126 Bool_t HandleObjectRequest(); 00127 00130 Bool_t SendObject(TObject* obj); 00131 00132 TGo4AnalysisClient* fxAnalysisClient; 00133 TGo4Analysis* fxAnalysis; 00134 TGo4ThreadHandler* fxThreadHandler; 00135 00137 TString fxServerName; 00138 00140 TString fxServerPass; 00141 00143 TString fxConnectorName; 00144 00146 TString fxObjectThreadName; 00147 00149 Int_t fiServerPort; 00150 00152 TGo4Socket* fxTransport; 00153 00155 UInt_t fuObjectPort; 00156 00159 TGo4Socket * fxConnectTransport; 00160 00163 TGo4Socket * fxDisConnectTransport; 00164 00166 TString fcConnectHost; 00167 00169 UInt_t fuConnectPort; 00170 00172 Bool_t fbConnectRequest; 00173 00175 Bool_t fbDisConnectRequest; 00176 00178 Bool_t fbConnectIsOpen; 00179 00182 Bool_t fbConnectIsDone; 00183 00186 Bool_t fbConnectIsClose; 00187 00192 TGo4ObjConnectorTimer * fxConnectorTimer; 00193 00195 Bool_t fbUseObjectServer; 00196 00197 00198 ClassDef(TGo4HistogramServer,1) 00199 }; 00200 00201 #endif //TGO4HISTOGRAMSERVER_H