GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4ClientTask.h
Go to the documentation of this file.
1 // $Id: TGo4ClientTask.h 2689 2020-01-10 13:47:49Z linev $
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 TGO4CLIENTTASK_H
15 #define TGO4CLIENTTASK_H
16 
17 #include "TGo4Task.h"
18 
19 #include "TGo4Command.h"
20 #include "TString.h"
21 
22 class TMutex;
23 class TGo4Command;
24 class TGo4BufferQueue;
25 class TGo4TaskHandler;
26 
33 class TGo4ClientTask : public TGo4Task {
34 
35  public:
36 
37  TGo4ClientTask(const char* name,
38  const char* serverhost="localhost",
39  UInt_t negotiationport=0,
40  Bool_t blockingmode=kTRUE,
41  Bool_t standalone=kFALSE,
42  Bool_t autostart=kFALSE,
43  Bool_t autocreate=kTRUE,
44  Bool_t ismaster=kFALSE,
45  Bool_t autoconnect=kTRUE);
46 
47  virtual ~TGo4ClientTask();
48 
53  virtual Int_t Initialization();
54 
60  virtual void Quit();
61 
68  virtual TGo4TaskStatus* CreateStatus();
69 
71 
75  void AddLocalCommand(TGo4Command * com);
76 
77  TGo4BufferQueue* GetCommandQueue(const char* task=0);
78 
79  TGo4BufferQueue* GetStatusQueue(const char* task=0);
80 
81  TGo4BufferQueue* GetDataQueue(const char* task=0);
82 
88  Bool_t ConnectServer(const char* node, UInt_t negport,
90  const char* passwd=0);
91 
98  Bool_t DisconnectServer(Bool_t isterminating=kFALSE);
99 
100  const char* GetServerHostName(){return fxServerHostname.Data();}
101 
102  Bool_t IsConnected() const { return fbServerConnected; }
103 
104  protected:
105 
112  virtual void UpdateStatus(TGo4TaskStatus* state);
113 
114  private:
118 
124 
133 
138  ClassDef(TGo4ClientTask,1)
139 };
140 
141 #endif //TGO4CLIENTTASK_H
TGo4BufferQueue * fxStatusQ
Bool_t DisconnectServer(Bool_t isterminating=kFALSE)
Go4CommandMode_t
Definition: TGo4Command.h:27
TGo4BufferQueue * GetStatusQueue(const char *task=0)
TGo4ClientTask(const char *name, const char *serverhost="localhost", UInt_t negotiationport=0, Bool_t blockingmode=kTRUE, Bool_t standalone=kFALSE, Bool_t autostart=kFALSE, Bool_t autocreate=kTRUE, Bool_t ismaster=kFALSE, Bool_t autoconnect=kTRUE)
virtual TGo4TaskStatus * CreateStatus()
virtual ~TGo4ClientTask()
TGo4BufferQueue * fxCommandQ
TGo4TaskHandler * fxTaskHandler
Bool_t fbServerConnected
TGo4BufferQueue * GetDataQueue(const char *task=0)
virtual void Quit()
TGo4BufferQueue * GetCommandQueue(const char *task=0)
TGo4BufferQueue * fxDataQ
virtual Int_t Initialization()
Bool_t IsConnected() const
Bool_t ConnectServer(const char *node, UInt_t negport, Go4CommandMode_t role=kGo4ComModeRefused, const char *passwd=0)
const char * GetServerHostName()
TGo4TaskHandler * GetTaskHandler()
void AddLocalCommand(TGo4Command *com)
TString fxServerHostname
virtual void UpdateStatus(TGo4TaskStatus *state)