GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4ObjClient.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 TGO4OBJCLIENT_H
15 #define TGO4OBJCLIENT_H
16 
17 #include "TNamed.h"
18 
20 class TGo4Socket;
21 class TBuffer;
22 
29 class TGo4ObjClient : public TNamed {
30  public:
31 
32  TGo4ObjClient();
33 
34  TGo4ObjClient(const char *clientname,
35  const char *base = nullptr,
36  const char *passwd = nullptr,
37  const char *host = nullptr,
38  Int_t port = 0);
39 
40  virtual ~TGo4ObjClient();
41 
45  TGo4AnalysisObjectNames *RequestNamesList(const char *base = nullptr,
46  const char *passwd = nullptr,
47  const char *host = nullptr,
48  Int_t port = 0);
49 
53  TObject *RequestObject(const char *objectname,
54  const char *base = nullptr,
55  const char *passwd = nullptr,
56  const char *host = nullptr,
57  Int_t port = 0);
58 
59  void SetBase(const char *serverbase) { fxServerName = serverbase; }
60  void SetPasswd(const char *serverpasswd) { fxServerPass = serverpasswd; }
61  void SetHost(const char *serverhost) { fxHostname = serverhost; }
62  void SetPort(Int_t port) { fiPort = port; }
63 
64  const char *GetBase() const { return fxServerName.Data(); }
65  const char *GetPasswd() const { return fxServerPass.Data(); }
66  const char *GetHost() const { return fxHostname.Data(); }
67  Int_t GetPort() const { return fiPort; }
68 
69  protected:
70 
72  void SendCommand(const char *com);
73 
75  TObject *ReceiveObject();
76 
77  private:
78 
80  TString fxServerName;
81 
83  TString fxServerPass;
84 
86  TString fxHostname;
87 
89  Int_t fiPort{0};
90 
92  TGo4Socket *fxTransport{nullptr};
93 
95  void SetParms(const char *base, const char *passwd,
96  const char *host, Int_t port);
97 
98  Int_t ConnectServer();
99 
100  Int_t DisconnectServer();
101 
103  TBuffer *ReceiveBuffer();
104 
105  ClassDefOverride(TGo4ObjClient,1)
106 };
107 
108 #endif
void SetBase(const char *serverbase)
Definition: TGo4ObjClient.h:59
void SetPasswd(const char *serverpasswd)
Definition: TGo4ObjClient.h:60
TString fxServerName
Definition: TGo4ObjClient.h:80
const char * GetHost() const
Definition: TGo4ObjClient.h:66
TObject * ReceiveObject()
TString fxHostname
Definition: TGo4ObjClient.h:86
TGo4Socket * fxTransport
Definition: TGo4ObjClient.h:92
const char * GetBase() const
Definition: TGo4ObjClient.h:64
Int_t GetPort() const
Definition: TGo4ObjClient.h:67
void SetHost(const char *serverhost)
Definition: TGo4ObjClient.h:61
void SetParms(const char *base, const char *passwd, const char *host, Int_t port)
void SetPort(Int_t port)
Definition: TGo4ObjClient.h:62
TString fxServerPass
Definition: TGo4ObjClient.h:83
Int_t DisconnectServer()
TGo4AnalysisObjectNames * RequestNamesList(const char *base=nullptr, const char *passwd=nullptr, const char *host=nullptr, Int_t port=0)
virtual ~TGo4ObjClient()
TObject * RequestObject(const char *objectname, const char *base=nullptr, const char *passwd=nullptr, const char *host=nullptr, Int_t port=0)
Int_t ConnectServer()
const char * GetPasswd() const
Definition: TGo4ObjClient.h:65
void SendCommand(const char *com)
TBuffer * ReceiveBuffer()