GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4ClientTask.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 TGO4CLIENTTASK_H
15#define TGO4CLIENTTASK_H
16
17#include "TGo4Task.h"
18
19#include "TGo4Command.h"
20#include "TString.h"
21
22class TMutex;
23class TGo4Command;
24class TGo4BufferQueue;
25class TGo4TaskHandler;
26
34class 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 Int_t Initialization() override;
55
61 void Quit() override;
62
69 TGo4TaskStatus *CreateStatus() override;
70
72
77
78 TGo4BufferQueue *GetCommandQueue(const char *task = nullptr) override;
79
80 TGo4BufferQueue *GetStatusQueue(const char *task = nullptr) override;
81
82 TGo4BufferQueue *GetDataQueue(const char *task = nullptr) override;
83
89 Bool_t ConnectServer(const char *node, UInt_t negport,
91 const char *passwd = nullptr);
92
99 Bool_t DisconnectServer(Bool_t isterminating=kFALSE);
100
101 const char *GetServerHostName() const { return fxServerHostname.Data(); }
102
103 Bool_t IsConnected() const { return fbServerConnected; }
104
105 protected:
106
113 void UpdateStatus(TGo4TaskStatus *state) override;
114
115 private:
119
125
133 Bool_t fbAutoConnect{kFALSE};
134
138 Bool_t fbServerConnected{kFALSE};
139
140 ClassDefOverride(TGo4ClientTask,1)
141};
142
143#endif //TGO4CLIENTTASK_H
Go4CommandMode_t
These values define command execution rights.
Definition TGo4Command.h:27
@ kGo4ComModeRefused
Definition TGo4Command.h:28
Class containing a pointer queue for TBuffers.
This class controls a client application running in a task which is controlled by another server task...
virtual ~TGo4ClientTask()
Bool_t IsConnected() const
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)
TGo4BufferQueue * fxStatusQ
void UpdateStatus(TGo4TaskStatus *state) override
method needed by method CreateStatus of any status subclasses to set the values of the clienttask spe...
TGo4TaskHandler * fxTaskHandler
aggregationByValue
TGo4BufferQueue * GetStatusQueue(const char *task=nullptr) override
Int_t Initialization() override
override the ThreadManager Initialization used by AppControlTimer to let this thing initialize the cl...
TGo4BufferQueue * GetDataQueue(const char *task=nullptr) override
const char * GetServerHostName() const
TGo4BufferQueue * fxDataQ
Bool_t fbAutoConnect
!True if client task shall try to connect automatically at Initialization.
Bool_t ConnectServer(const char *node, UInt_t negport, Go4CommandMode_t role=kGo4ComModeRefused, const char *passwd=nullptr)
Connect this client to a waiting server task on node with negotiation channel negport.
TGo4BufferQueue * fxCommandQ
void AddLocalCommand(TGo4Command *com)
Put command into the command queue for local execution in main thread.
Bool_t fbServerConnected
true if connection to server is established, otherwise false
TGo4TaskStatus * CreateStatus() override
create a status object with information on the current client state.
Bool_t DisconnectServer(Bool_t isterminating=kFALSE)
Disconnect the current server task, but do not terminate the client.
TGo4BufferQueue * GetCommandQueue(const char *task=nullptr) override
TGo4TaskHandler * GetTaskHandler() override
void Quit() override
Quit the client; method to be called from command object, may be overridden in user implementation.
TString fxServerHostname
hostname of server machine
This is the Go4 Abstract Command Class; part of the Base command pattern.
Definition TGo4Command.h:35
This class is responsible for the interconnection of two tasks: provided are three communication chan...
Task status.
TGo4Task(const char *name, Bool_t blockingmode, Bool_t autostart=kFALSE, Bool_t autocreate=kTRUE, Bool_t ismaster=kFALSE)
Definition TGo4Task.cxx:39