GSI Object Oriented Online Offline (Go4) GO4-6.4.0
|
Baseclass for all slave process entities. More...
#include <TGo4Slave.h>
Public Member Functions | |
TGo4Slave () | |
TGo4Slave (const char *name, Bool_t isserver=kTRUE, const char *serverhost="localhost", UInt_t negotport=5000) | |
virtual | ~TGo4Slave () |
virtual TGo4TaskStatus * | CreateStatus () |
create a status object with information on the current (slave) task. | |
virtual void | ExecuteString (const char *command) |
Execute string command. | |
TGo4ThreadHandler * | GetThreadHandler () |
virtual Int_t | Initialization () |
Overrides the ThreadManager Initialization; is used to setup the client connections on demand; checks for fbConnectRequest flag. | |
virtual void | KillMain () |
Kill the main thread; method to be called from command, should be overridden in user implementation. | |
Bool_t | MainIsRunning () const |
TGo4Command * | NextCommand () |
Delivers next command from command queue. | |
virtual void | RestartMain () |
Restart the main thread; method to be called from command, should be overridden in user implementation. | |
void | SendObject (TObject *obj, const char *receiver=nullptr) |
Send object via data channel to the server. | |
void | SendStatus (TGo4Status *stat, const char *receiver=nullptr) |
Send status object via status channel to the server. | |
void | SendStatusBuffer () |
Send internal status buffer to the server. | |
virtual void | SendStatusMessage (Int_t level, Bool_t printout, const TString &text) |
Send message string in a status object to the gui. | |
virtual void | Start () |
General start method of slave application to be called from remote command; should be re-implemented by application. | |
virtual void | Stop () |
General stop method of slave application to be called from remote command; should be re-implemented by application. | |
virtual void | Terminate (Bool_t termapp=kTRUE) |
virtual void | TerminateFast () |
void | UpdateStatusBuffer () |
Create status object and stream it into the status send buffer. | |
![]() | |
TGo4TaskOwner () | |
TGo4TaskOwner (Bool_t isserver) | |
virtual | ~TGo4TaskOwner () |
const char * | GetName () const |
TGo4Task * | GetTask () const |
TMutex * | GetTaskManagerMutex () |
Access to taskmanager mutex; to be locked outside main mutex. | |
Bool_t | IsBeingQuit () |
Bool_t | IsConnected () |
Bool_t | IsServer () const |
virtual void | Quit () |
Quit this instance and the owned task; method to be called from command object, may be overridden in user implementation. | |
virtual Int_t | StartWorkThreads () |
Start the working threads of the task owner implementation; this method is used after the current connection has changed, to continue reading/writing the queues. | |
virtual Int_t | StopWorkThreads () |
stop the working threads of the task owne implementation; this method is used before the current connection is changed to prevent reading/writing and waiting for the wrong queues. | |
![]() | |
TGo4CommandReceiver () | |
virtual | ~TGo4CommandReceiver () |
Protected Member Functions | |
virtual void | UpdateStatus (TGo4TaskStatus *state) |
method needed by method CreateStatus of any status subclasses to set the values of the clienttask specific part of the status object. | |
![]() | |
void | SetTask (TGo4Task *task, Bool_t delold=kTRUE) |
Private Attributes | |
Bool_t | fbMainIsRunning {kFALSE} |
True if analysis main loop is running. | |
Baseclass for all slave process entities.
A Slave receives commands and may send data and status objects via the TGo4Task connection. This can run either as server or client task.
Definition at line 33 of file TGo4Slave.h.
TGo4Slave::TGo4Slave | ( | ) |
Definition at line 53 of file TGo4Slave.cxx.
References fbMainIsRunning.
Referenced by TGo4AnalysisClient::TGo4AnalysisClient(), and TGo4AnalysisClient::TGo4AnalysisClient().
TGo4Slave::TGo4Slave | ( | const char * | name, |
Bool_t | isserver = kTRUE, | ||
const char * | serverhost = "localhost", | ||
UInt_t | negotport = 5000 ) |
Definition at line 25 of file TGo4Slave.cxx.
References TGo4TaskOwner::TGo4TaskOwner(), fbMainIsRunning, TGo4CommandInvoker::Instance(), TGo4TaskOwner::IsServer(), TGo4CommandInvoker::Register(), TGo4CommandInvoker::SetCommandList(), TGo4TaskOwner::SetTask(), TGo4TaskOwner::TGo4ServerTask, and TGo4TaskOwner::TGo4Task.
|
virtual |
Definition at line 57 of file TGo4Slave.cxx.
References TGo4CommandInvoker::UnRegister().
|
virtual |
create a status object with information on the current (slave) task.
this object may be sent to the master or may be used to restore current status by memento mechanism
Reimplemented in TGo4AnalysisClient.
Definition at line 97 of file TGo4Slave.cxx.
References TGo4TaskOwner::GetName(), and UpdateStatus().
|
virtual |
Execute string command.
Uses gInterpreter by default. May be overridden to evaluate go4 command strings in subclass.
Reimplemented in TGo4AnalysisClient.
Definition at line 157 of file TGo4Slave.cxx.
TGo4ThreadHandler * TGo4Slave::GetThreadHandler | ( | ) |
Definition at line 133 of file TGo4Slave.cxx.
References TGo4TaskOwner::GetTask(), and TGo4ThreadManager::GetWorkHandler().
Referenced by TGo4AnalysisClient::~TGo4AnalysisClient(), TGo4AnalysisClient::Constructor(), TGo4AnalysisClient::KillMain(), TGo4AnalysisClient::RestartMain(), TGo4AnalysisClient::Start(), TGo4AnalysisClient::StartWorkThreads(), TGo4AnalysisClient::StopWorkThreads(), and TGo4AnalysisClient::TerminateFast().
|
virtual |
Overrides the ThreadManager Initialization; is used to setup the client connections on demand; checks for fbConnectRequest flag.
Reimplemented in TGo4AnalysisClient.
Definition at line 127 of file TGo4Slave.cxx.
|
virtual |
Kill the main thread; method to be called from command, should be overridden in user implementation.
Reimplemented in TGo4AnalysisClient.
Definition at line 76 of file TGo4Slave.cxx.
|
inline |
Definition at line 98 of file TGo4Slave.h.
References fbMainIsRunning.
Referenced by TGo4AnalysisWebStatus::ApplyStatus(), TGo4ComCloseAnalysis::ExeCom(), TGo4ComInitAnalysis::ExeCom(), TGo4ComSetAnalysisStatus::ExeCom(), TGo4AnalysisClient::Start(), and TGo4AnalysisClient::Stop().
TGo4Command * TGo4Slave::NextCommand | ( | ) |
Delivers next command from command queue.
Definition at line 110 of file TGo4Slave.cxx.
References TGo4TaskOwner::GetTask(), and TGo4Task::NextCommand().
|
virtual |
Restart the main thread; method to be called from command, should be overridden in user implementation.
Reimplemented in TGo4AnalysisClient.
Definition at line 81 of file TGo4Slave.cxx.
void TGo4Slave::SendObject | ( | TObject * | obj, |
const char * | receiver = nullptr ) |
Send object via data channel to the server.
Definition at line 115 of file TGo4Slave.cxx.
References TGo4TaskOwner::GetTask(), and TGo4Task::SendObject().
Referenced by TGo4ComGetCurrentEvent::ExeCom(), TGo4ComGetEnvelope::ExeCom(), TGo4ComGetNamesList::ExeCom(), TGo4ComGetObjectStatus::ExeCom(), TGo4AnalysisClient::SendAnalysisObject(), and TGo4AnalysisClient::SendNamesList().
void TGo4Slave::SendStatus | ( | TGo4Status * | stat, |
const char * | receiver = nullptr ) |
Send status object via status channel to the server.
Definition at line 121 of file TGo4Slave.cxx.
References TGo4TaskOwner::GetTask(), and TGo4Task::SendStatus().
Referenced by TGo4ComGetAnalysisStatus::ExeCom(), and TGo4AnalysisClient::SendAnalysisStatus().
void TGo4Slave::SendStatusBuffer | ( | ) |
Send internal status buffer to the server.
Definition at line 139 of file TGo4Slave.cxx.
References TGo4TaskOwner::GetTask(), and TGo4Task::SendStatusBuffer().
Referenced by TGo4AnalysisClient::SendAnalysisClientStatus().
|
virtual |
Send message string in a status object to the gui.
Will be displayed in status window. Level indicates info, warning or error,
Reimplemented in TGo4AnalysisClient.
Definition at line 145 of file TGo4Slave.cxx.
References TGo4TaskOwner::GetTask(), and TGo4Task::SendStatusMessage().
Referenced by TGo4AnalysisClient::SendStatusMessage().
|
virtual |
General start method of slave application to be called from remote command; should be re-implemented by application.
Reimplemented in TGo4AnalysisClient.
Definition at line 63 of file TGo4Slave.cxx.
References TGo4Log::Debug(), fbMainIsRunning, and TGo4TaskOwner::GetName().
Referenced by TGo4AnalysisClient::Start().
|
virtual |
General stop method of slave application to be called from remote command; should be re-implemented by application.
Reimplemented in TGo4AnalysisClient.
Definition at line 70 of file TGo4Slave.cxx.
References TGo4Log::Debug(), fbMainIsRunning, and TGo4TaskOwner::GetName().
Referenced by TGo4AnalysisClient::Constructor(), TGo4AnalysisClient::Initialization(), and TGo4AnalysisClient::Stop().
|
virtual |
Reimplemented in TGo4AnalysisClient.
Definition at line 86 of file TGo4Slave.cxx.
References TGo4TaskOwner::GetTask().
Referenced by TerminateFast().
|
virtual |
Reimplemented in TGo4AnalysisClient.
Definition at line 92 of file TGo4Slave.cxx.
References Terminate().
Referenced by TGo4TaskHandlerAbortException::Handle().
|
protectedvirtual |
method needed by method CreateStatus of any status subclasses to set the values of the clienttask specific part of the status object.
Reimplemented in TGo4AnalysisClient.
Definition at line 104 of file TGo4Slave.cxx.
References TGo4TaskOwner::GetTask(), and TGo4Task::UpdateStatus().
Referenced by CreateStatus(), and TGo4AnalysisClient::UpdateStatus().
void TGo4Slave::UpdateStatusBuffer | ( | ) |
Create status object and stream it into the status send buffer.
To be executed from the main thread; buffer will be send by status thread.
Definition at line 152 of file TGo4Slave.cxx.
References TGo4TaskOwner::GetTask(), and TGo4Task::UpdateStatusBuffer().
Referenced by TGo4AnalysisClient::Constructor(), TGo4AnalysisClient::Initialization(), TGo4AnalysisClient::Start(), and TGo4AnalysisClient::Stop().
|
private |
True if analysis main loop is running.
If false, the slave main thread will just wait on incoming commands without processing main loop.
Definition at line 40 of file TGo4Slave.h.
Referenced by TGo4Slave(), TGo4Slave(), MainIsRunning(), Start(), and Stop().