GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4Slave.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 TGO4SLAVE_H
15#define TGO4SLAVE_H
16
17#include "TGo4TaskOwner.h"
18
19class TGo4Status;
20class TGo4TaskStatus;
21class TGo4Command;
23class TMutex;
24class TObject;
25class TString;
26
33class TGo4Slave : public TGo4TaskOwner {
34 private:
35
40 Bool_t fbMainIsRunning{kFALSE};
41
42 protected:
43
50 virtual void UpdateStatus(TGo4TaskStatus *state);
51
52
53 public:
54 TGo4Slave();
55
56 TGo4Slave(const char *name, Bool_t isserver=kTRUE, const char *serverhost="localhost", UInt_t negotport=5000);
57
58 virtual ~TGo4Slave();
59
64 virtual void Start();
65
70 virtual void Stop();
71
77 virtual void KillMain();
78
84 virtual void RestartMain();
85
86 virtual void Terminate (Bool_t termapp=kTRUE);
87
88 virtual void TerminateFast ();
89
97
98 Bool_t MainIsRunning() const { return fbMainIsRunning; }
99
102
104 void SendObject(TObject *obj, const char *receiver = nullptr);
105
107 void SendStatus(TGo4Status *stat, const char *receiver = nullptr);
108
109
114 virtual Int_t Initialization();
115
117
119 void SendStatusBuffer();
120
125 virtual void SendStatusMessage(Int_t level, Bool_t printout, const TString &text);
126
133 void UpdateStatusBuffer();
134
139 virtual void ExecuteString(const char *command);
140
141};
142
143#endif //TGO4SLAVE_H
This is the Go4 Abstract Command Class; part of the Base command pattern.
Definition TGo4Command.h:35
virtual TGo4TaskStatus * CreateStatus()
create a status object with information on the current (slave) task.
Definition TGo4Slave.cxx:97
virtual void TerminateFast()
Definition TGo4Slave.cxx:92
virtual void Terminate(Bool_t termapp=kTRUE)
Definition TGo4Slave.cxx:86
virtual void Start()
General start method of slave application to be called from remote command; should be re-implemented ...
Definition TGo4Slave.cxx:63
virtual ~TGo4Slave()
Definition TGo4Slave.cxx:57
virtual Int_t Initialization()
Overrides the ThreadManager Initialization; is used to setup the client connections on demand; checks...
virtual void SendStatusMessage(Int_t level, Bool_t printout, const TString &text)
Send message string in a status object to the gui.
void SendStatus(TGo4Status *stat, const char *receiver=nullptr)
Send status object via status channel to the server.
virtual void KillMain()
Kill the main thread; method to be called from command, should be overridden in user implementation.
Definition TGo4Slave.cxx:76
TGo4ThreadHandler * GetThreadHandler()
void SendStatusBuffer()
Send internal status buffer to the server.
virtual void UpdateStatus(TGo4TaskStatus *state)
method needed by method CreateStatus of any status subclasses to set the values of the clienttask spe...
TGo4Command * NextCommand()
Delivers next command from command queue.
void SendObject(TObject *obj, const char *receiver=nullptr)
Send object via data channel to the server.
virtual void ExecuteString(const char *command)
Execute string command.
Bool_t MainIsRunning() const
Definition TGo4Slave.h:98
virtual void Stop()
General stop method of slave application to be called from remote command; should be re-implemented b...
Definition TGo4Slave.cxx:70
Bool_t fbMainIsRunning
True if analysis main loop is running.
Definition TGo4Slave.h:40
void UpdateStatusBuffer()
Create status object and stream it into the status send buffer.
virtual void RestartMain()
Restart the main thread; method to be called from command, should be overridden in user implementatio...
Definition TGo4Slave.cxx:81
Task status.
Go4 thread handler.