GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4HistogramServer.h
Go to the documentation of this file.
1// $Id$
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 TGO4HISTOGRAMSERVER_H
15#define TGO4HISTOGRAMSERVER_H
16
17#include "TGo4CommandReceiver.h"
18#include "TString.h"
19
21class TGo4Analysis;
24class TGo4Socket;
25
34
36
38
39 public:
40
42
44 const char *servername = "localhost",
45 const char *password = "go4",
46 Bool_t useobjectserver = kFALSE);
47
48 virtual ~TGo4HistogramServer();
49
51 Int_t ServeObjectClient();
52
54 UInt_t GetObjPort();
55
59 virtual Int_t TimerConnect();
60
62
63 TGo4Analysis *GetAnalysis() const { return fxAnalysis; }
64
66 static const char *fgcCONTHREADNAME;
67
69 static const char *fgcOBJTHREADNAME;
70
72 static const char *fgcSHUTDOWNNAME;
73
75 static const char *fgcCOMGETLIST;
76
78 static const UInt_t fguTIMERPERIOD;
79
81 static const Int_t fgiOPENWAITCYCLES;
82
84 static const UInt_t fguOPENWAITCYCLETIME;
85
87 static const Int_t fgiCLOSEWAITCYCLES;
88
90 static const UInt_t fguCLOSEWAITCYCLETIME;
91
93 static const Int_t fgiCONNECTWAITCYCLES;
94
96 static const UInt_t fguCONNECTWAITCYCLETIME;
97
98 private:
99
100 const char *ConnectorName() const { return fxConnectorName.Data(); }
101
102 const char *ObjectThreadName() const { return fxObjectThreadName.Data(); }
103
104 const char *ConnectHost() const { return fcConnectHost.Data(); }
105
106 void SetConnect(TGo4Socket *trans, const char *host, UInt_t port);
107
108 void SetDisConnect(TGo4Socket *trans);
109
110 Int_t WaitForOpen();
111
112 Int_t WaitForClose();
113
114 Int_t WaitForConnection();
115
118
120 Bool_t CheckLogin();
121
123 Int_t ConnectObjectClient();
124
126 Bool_t HandleObjectRequest();
127
130 Bool_t SendObject(TObject *obj);
131
135
137 TString fxServerName;
138
140 TString fxServerPass;
141
144
147
149 Int_t fiServerPort{0};
150
153
155 UInt_t fuObjectPort{0};
156
160
164
167
169 UInt_t fuConnectPort{0};
170
172 Bool_t fbConnectRequest{kFALSE};
173
175 Bool_t fbDisConnectRequest{kFALSE};
176
178 Bool_t fbConnectIsOpen{kFALSE};
179
182 Bool_t fbConnectIsDone{kFALSE};
183
186 Bool_t fbConnectIsClose{kFALSE};
187
193
195 Bool_t fbUseObjectServer{kFALSE};
196
197 ClassDef(TGo4HistogramServer,1)
198};
199
200#endif //TGO4HISTOGRAMSERVER_H
The mother of all go4 analysis.
Handles a histogram server (mbs histogram protocol) for the histograms registered in the analysis.
TGo4ObjConnectorTimer * fxConnectorTimer
timer responsible for the connection/disconnection of clients; independent of application control tim...
Bool_t fbConnectIsOpen
True if fxConnectTransport waits in server Open() call.
Bool_t fbDisConnectRequest
True if fxConnectTransport shall be Close() by Timer.
static const char * fgcSHUTDOWNNAME
This string is send as histogram name for termination connection.
TGo4Socket * fxConnectTransport
link to the next TaskHandler transport instance that shall be connected by the Object connector Timer...
TString fxServerPass
contains api server password
const char * ConnectorName() const
static const char * fgcCOMGETLIST
command string for object server nameslist request
Bool_t SendObject(TObject *obj)
Send object to the current object client.
void DisconnectObjectClient()
Terminate connection to current object client, keep waiting for the next one.
static const UInt_t fguCONNECTWAITCYCLETIME
Time for each connect wait cycle, in ms.
static const char * fgcOBJTHREADNAME
object server connector thread name
static const UInt_t fguOPENWAITCYCLETIME
Time for each open wait cycle, in ms.
Bool_t fbConnectIsDone
True if fxConnectTransport has returned from Open(), i.e.
TString fxServerName
contains api server name
TString fcConnectHost
hostname for timer connect
Bool_t CheckLogin()
Checks basename and passwd login of connected client.
friend class TGo4HisConnectorRunnable
Bool_t fbConnectRequest
True if fxConnectTransport shall be Open() by Timer.
Bool_t fbConnectIsClose
True if fxConnectTransport has returned from Close(), i.e.
TGo4AnalysisClient * GetAnalysisClient() const
UInt_t fuConnectPort
port number for timer connect
virtual Int_t TimerConnect()
This method is used by the object connectortimer Notify to connect or disconnect a transportchannel (...
TGo4ThreadHandler * fxThreadHandler
UInt_t fuObjectPort
port number for the object server connections
Bool_t HandleObjectRequest()
Ask for which object to send and give it to the client.
static const Int_t fgiCONNECTWAITCYCLES
Maximum cycles to wait until transport is connected.
static const char * fgcCONTHREADNAME
histogram server connector thread name
TString fxObjectThreadName
Name of object server thread.
void SetDisConnect(TGo4Socket *trans)
TGo4Analysis * GetAnalysis() const
Int_t ConnectObjectClient()
Starts server socket waiting for the next client.
void SetConnect(TGo4Socket *trans, const char *host, UInt_t port)
const char * ConnectHost() const
TString fxConnectorName
Name of connector thread.
TGo4AnalysisClient * fxAnalysisClient
UInt_t GetObjPort()
returns the portnumber for object server connection
Int_t fiServerPort
port number for server socket
const char * ObjectThreadName() const
static const Int_t fgiCLOSEWAITCYCLES
Maximum cycles to wait until transport is closed.
TGo4Socket * fxTransport
socket for object server
Int_t ServeObjectClient()
Used by object connector runnable to serve client request.
static const Int_t fgiOPENWAITCYCLES
Maximum cycles to wait until transport is open.
static const UInt_t fguCLOSEWAITCYCLETIME
Time for each close wait cycle, in ms.
static const UInt_t fguTIMERPERIOD
Period of connector timer, in ms.
TGo4Socket * fxDisConnectTransport
link to the next TaskHandler transport instance that shall be disconnected by the connector Timer wit...
Bool_t fbUseObjectServer
Switches Go4 objectserver option on/off.
timer aggregated to the histogram server which is responsible to establish connections of the go4 obj...
Go4 thread handler.