Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

TGo4Slave Class Reference

Baseclass for all slave process entities. More...

#include <TGo4Slave.h>

Inheritance diagram for TGo4Slave:

TGo4TaskOwner TGo4CommandReceiver TGo4AnalysisClient List of all members.

Public Methods

 TGo4Slave ()
 TGo4Slave (const char *name, Bool_t isserver=kTRUE, const char *serverhost="localhost", UInt_t negotport=5000)
virtual ~TGo4Slave ()
virtual void Start ()
 General start method of slave application to be called from remote command; should be re-implemented by application. More...

virtual void Stop ()
 General stop method of slave application to be called from remote command; should be re-implemented by application. More...

virtual void KillMain ()
 Kill the main thread; method to be called from command, should be overridden in user implementation. More...

virtual void RestartMain ()
 Restart the main thread; method to be called from command, should be overridden in user implementation. More...

virtual void Terminate (Bool_t termapp=kTRUE)
virtual void TerminateFast ()
virtual TGo4TaskStatusCreateStatus ()
 create a status object with information on the current (slave) task. More...

Bool_t & MainIsRunning ()
TGo4CommandNextCommand ()
 Delivers next command from command queue. More...

void SendObject (TObject *obj, const char *receiver=0)
 Send object via data channel to the server. More...

void SendStatus (TGo4Status *stat, const char *receiver=0)
 Send status object via status channel to the server. More...

virtual Int_t Initialization ()
 Overrides the ThreadManager Initialization; is used to setup the client connections on demand; checks for fbConnectRequest flag. More...

TGo4ThreadHandlerGetThreadHandler ()
void SendStatusBuffer ()
 Send internal status buffer to the server. More...

void SendStatusMessage (Int_t level, Bool_t printout, const char *text,...)
 Send message string in a status object to the gui. More...

void UpdateStatusBuffer ()
 Create status object and stream it into the status send buffer. More...

virtual void ExecuteString (const Text_t *command)
 Execute string command. More...


Protected Methods

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. More...


Private Attributes

Bool_t fbMainIsRunning
 True if analysis main loop is running. More...


Detailed Description

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.


Constructor & Destructor Documentation

TGo4Slave::TGo4Slave  
 

Definition at line 58 of file TGo4Slave.cxx.

TGo4Slave::TGo4Slave const char *    name,
Bool_t    isserver = kTRUE,
const char *    serverhost = "localhost",
UInt_t    negotport = 5000
 

Definition at line 28 of file TGo4Slave.cxx.

References TGo4CommandInvoker::Instance(), TGo4TaskOwner::IsServer(), TGo4CommandInvoker::Register(), TGo4TaskOwner::SetTask(), and TGo4TaskOwner::TGo4ServerTask.

TGo4Slave::~TGo4Slave   [virtual]
 

Definition at line 63 of file TGo4Slave.cxx.


Member Function Documentation

void TGo4Slave::Start   [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 69 of file TGo4Slave.cxx.

References TGo4Log::Debug(), fbMainIsRunning, and TGo4TaskOwner::GetName().

Referenced by TGo4Task::Start(), and TGo4AnalysisClient::Start().

void TGo4Slave::Stop   [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 74 of file TGo4Slave.cxx.

References TGo4Log::Debug(), fbMainIsRunning, and TGo4TaskOwner::GetName().

Referenced by TGo4AnalysisClient::Constructor(), TGo4AnalysisClient::Initialization(), TGo4ServerTask::Shutdown(), TGo4Task::Stop(), and TGo4AnalysisClient::Stop().

void TGo4Slave::KillMain   [virtual]
 

Kill the main thread; method to be called from command, should be overridden in user implementation.

Reimplemented in TGo4AnalysisClient.

Definition at line 80 of file TGo4Slave.cxx.

Referenced by TGo4Task::KillMain().

void TGo4Slave::RestartMain   [virtual]
 

Restart the main thread; method to be called from command, should be overridden in user implementation.

Reimplemented in TGo4AnalysisClient.

Definition at line 85 of file TGo4Slave.cxx.

Referenced by TGo4Task::RestartMain().

void TGo4Slave::Terminate Bool_t    termapp = kTRUE [virtual]
 

Definition at line 90 of file TGo4Slave.cxx.

References TGo4TaskOwner::GetTask().

Referenced by TGo4ServerTask::Shutdown(), TGo4Task::Terminate(), and TerminateFast().

void TGo4Slave::TerminateFast   [virtual]
 

Reimplemented in TGo4AnalysisClient.

Definition at line 96 of file TGo4Slave.cxx.

References Terminate().

Referenced by TGo4TaskHandlerAbortException::Handle(), and TGo4Task::TerminateFast().

TGo4TaskStatus * TGo4Slave::CreateStatus   [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 102 of file TGo4Slave.cxx.

References TGo4TaskOwner::GetName(), and UpdateStatus().

Referenced by TGo4Task::UpdateStatusBuffer().

Bool_t& TGo4Slave::MainIsRunning   [inline]
 

Definition at line 79 of file TGo4Slave.h.

References fbMainIsRunning.

Referenced by TGo4ComSetAnalysisStatus::ExeCom(), TGo4ComInitAnalysis::ExeCom(), TGo4ComCloseAnalysis::ExeCom(), TGo4Analysis::IsRunning(), TGo4Task::NextCommand(), TGo4AnalysisMainRunnable::PostRun(), TGo4AnalysisWatchRunnable::Run(), TGo4AnalysisMainRunnable::Run(), TGo4AnalysisClient::Start(), and TGo4AnalysisClient::Stop().

TGo4Command * TGo4Slave::NextCommand  
 

Delivers next command from command queue.

Definition at line 115 of file TGo4Slave.cxx.

References TGo4TaskOwner::GetTask(), and TGo4Task::NextCommand().

Referenced by TGo4Analysis::Process(), and TGo4AnalysisMainRunnable::Run().

void TGo4Slave::SendObject TObject *    obj,
const char *    receiver = 0
 

Send object via data channel to the server.

Definition at line 123 of file TGo4Slave.cxx.

References TGo4TaskOwner::GetTask(), and TGo4Task::SendObject().

Referenced by TGo4ComGetTreeStructure::ExeCom(), TGo4ComGetPicture::ExeCom(), TGo4ComGetParameter::ExeCom(), TGo4ComGetObjectStatus::ExeCom(), TGo4ComGetObject::ExeCom(), TGo4ComGetNamesList::ExeCom(), TGo4ComGetEnvelope::ExeCom(), TGo4ComGetDynamicEntryStatus::ExeCom(), TGo4ComGetCurrentEvent::ExeCom(), TGo4ComGetCondition::ExeCom(), TGo4ComGetCanvas::ExeCom(), TGo4AnalysisClient::SendAnalysisObject(), TGo4AnalysisClient::SendNamesList(), and TGo4Analysis::SendObjectToGUI().

void TGo4Slave::SendStatus TGo4Status   stat,
const char *    receiver = 0
 

Send status object via status channel to the server.

Definition at line 129 of file TGo4Slave.cxx.

References TGo4TaskOwner::GetTask(), and TGo4Task::SendStatus().

Referenced by TGo4ComGetAnalysisStatus::ExeCom(), and TGo4AnalysisClient::SendAnalysisStatus().

Int_t TGo4Slave::Initialization   [virtual]
 

Overrides the ThreadManager Initialization; is used to setup the client connections on demand; checks for fbConnectRequest flag.

Reimplemented in TGo4AnalysisClient.

Definition at line 135 of file TGo4Slave.cxx.

Referenced by TGo4Task::Initialization().

TGo4ThreadHandler * TGo4Slave::GetThreadHandler  
 

Definition at line 141 of file TGo4Slave.cxx.

References TGo4TaskOwner::GetTask(), and TGo4ThreadManager::GetWorkHandler().

Referenced by TGo4AnalysisClient::Constructor(), TGo4AnalysisClient::KillMain(), TGo4AnalysisClient::RestartMain(), TGo4AnalysisClient::Start(), TGo4AnalysisClient::StartWorkThreads(), TGo4AnalysisClient::StopWorkThreads(), TGo4AnalysisClient::TerminateFast(), TGo4HistogramServer::TGo4HistogramServer(), and TGo4AnalysisClient::~TGo4AnalysisClient().

void TGo4Slave::SendStatusBuffer  
 

Send internal status buffer to the server.

Definition at line 150 of file TGo4Slave.cxx.

References TGo4TaskOwner::GetTask(), and TGo4Task::SendStatusBuffer().

Referenced by TGo4AnalysisClient::SendAnalysisClientStatus().

void TGo4Slave::SendStatusMessage Int_t    level,
Bool_t    printout,
const char *    text,
...   
 

Send message string in a status object to the gui.

Will be displayed in status window. Level indicates info, warning or error,

Definition at line 155 of file TGo4Slave.cxx.

References TGo4TaskOwner::GetTask(), and TGo4Task::SendStatusMessage().

Referenced by TGo4ComStopHistoServ::ExeCom(), TGo4ComStartHistoServ::ExeCom(), TGo4ComSetStore::ExeCom(), TGo4ComSetSource::ExeCom(), TGo4ComSetProtections::ExeCom(), TGo4ComSetProcessor::ExeCom(), TGo4ComSetPrintEvent::ExeCom(), TGo4ComSetPicture::ExeCom(), TGo4ComSetParameter::ExeCom(), TGo4ComSetLastStep::ExeCom(), TGo4ComSetFirstStep::ExeCom(), TGo4ComSetDynamicEntry::ExeCom(), TGo4ComSetCondition::ExeCom(), TGo4ComSetCanvas::ExeCom(), TGo4ComSetAnalysisStatus::ExeCom(), TGo4ComSaveAnalysisStatus::ExeCom(), TGo4ComRemoveDynamicEntry::ExeCom(), TGo4ComPrintHistograms::ExeCom(), TGo4ComPrintDynList::ExeCom(), TGo4ComPrintConditions::ExeCom(), TGo4ComLoadAnalysisStatus::ExeCom(), TGo4ComInitAnalysis::ExeCom(), TGo4ComGetTreeStructure::ExeCom(), TGo4ComGetPicture::ExeCom(), TGo4ComGetParameter::ExeCom(), TGo4ComGetObjectStatus::ExeCom(), TGo4ComGetNamesList::ExeCom(), TGo4ComGetDynamicEntryStatus::ExeCom(), TGo4ComGetCurrentEvent::ExeCom(), TGo4ComGetCondition::ExeCom(), TGo4ComGetCanvas::ExeCom(), TGo4ComGetAnalysisStatus::ExeCom(), TGo4ComDeleteObject::ExeCom(), TGo4ComCreateObject::ExeCom(), TGo4ComCreateHistogram::ExeCom(), TGo4ComCloseAnalysis::ExeCom(), TGo4ComClearObject::ExeCom(), TGo4ComAutosave::ExeCom(), TGo4ComAddTreeHistogram::ExeCom(), TGo4AnalysisClient::Initialization(), TGo4AnalysisClient::KillMain(), TGo4AnalysisCommand::RefuseCom(), TGo4AnalysisClient::RestartMain(), TGo4AnalysisMainRunnable::Run(), TGo4AnalysisClient::SendAnalysisStatus(), TGo4Analysis::SendMessageToGUI(), TGo4AnalysisClient::SendNamesList(), TGo4AnalysisClient::Start(), and TGo4AnalysisClient::Stop().

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 169 of file TGo4Slave.cxx.

References TGo4TaskOwner::GetTask(), and TGo4Task::UpdateStatusBuffer().

Referenced by TGo4AnalysisClient::Constructor(), TGo4AnalysisClient::Initialization(), TGo4Analysis::MainCycle(), TGo4AnalysisWatchRunnable::Run(), TGo4AnalysisClient::Start(), and TGo4AnalysisClient::Stop().

void TGo4Slave::ExecuteString const Text_t *    command [virtual]
 

Execute string command.

Uses gInterpreter by default. May be overridden to evaluate go4 command strings in subclass.

Reimplemented in TGo4AnalysisClient.

Definition at line 173 of file TGo4Slave.cxx.

Referenced by TGo4Task::ExecuteString(), and TGo4AnalysisClient::ExecuteString().

void TGo4Slave::UpdateStatus TGo4TaskStatus   state [protected, virtual]
 

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 109 of file TGo4Slave.cxx.

References TGo4TaskOwner::GetTask(), and TGo4Task::UpdateStatus().

Referenced by CreateStatus(), and TGo4AnalysisClient::UpdateStatus().


Member Data Documentation

Bool_t TGo4Slave::fbMainIsRunning [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 137 of file TGo4Slave.h.

Referenced by MainIsRunning(), Start(), and Stop().


The documentation for this class was generated from the following files:
Generated on Tue Nov 8 10:56:54 2005 for Go4-v2.10-5 by doxygen1.2.15