GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4ClientTask.h
Go to the documentation of this file.
1 // $Id: TGo4ClientTask.h 1468 2015-06-01 06:35:12Z 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 für 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 
24 class TGo4Command;
25 class TGo4BufferQueue;
26 class TGo4TaskHandler;
27 
34 class TGo4ClientTask : public TGo4Task {
35 
36  public:
37 
38  TGo4ClientTask(const char* name,
39  const char* serverhost="localhost",
40  UInt_t negotiationport=0,
41  Bool_t blockingmode=kTRUE,
42  Bool_t standalone=kFALSE,
43  Bool_t autostart=kFALSE,
44  Bool_t autocreate=kTRUE,
45  Bool_t ismaster=kFALSE,
46  Bool_t autoconnect=kTRUE);
47 
48  virtual ~TGo4ClientTask();
49 
54  virtual Int_t Initialization();
55 
61  virtual void Quit();
62 
69  virtual TGo4TaskStatus* CreateStatus();
70 
72 
76  void AddLocalCommand(TGo4Command * com);
77 
78  TGo4BufferQueue* GetCommandQueue(const char* task=0);
79 
80  TGo4BufferQueue* GetStatusQueue(const char* task=0);
81 
82  TGo4BufferQueue* GetDataQueue(const char* task=0);
83 
89  Bool_t ConnectServer(const char* node, UInt_t negport,
91  const char* passwd=0);
92 
99  Bool_t DisconnectServer(Bool_t isterminating=kFALSE);
100 
101  const char* GetServerHostName(){return fxServerHostname.Data();}
102 
103  Bool_t IsConnected() const { return fbServerConnected; }
104 
105  protected:
106 
113  virtual void UpdateStatus(TGo4TaskStatus* state);
114 
115  private:
119 
125 
134 
139  ClassDef(TGo4ClientTask,1)
140 };
141 
142 #endif //TGO4CLIENTTASK_H
TGo4BufferQueue * fxStatusQ
Bool_t DisconnectServer(Bool_t isterminating=kFALSE)
Go4CommandMode_t
Definition: TGo4Command.h:28
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)