v2.10-0 (21000JUN2005)

Go4TaskHandler
Class TGo4Slave

Direct Known Subclasses:
TGo4AnalysisClient

class TGo4Slave
derived from TGo4TaskOwner

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.


Field Summary
 private Bool_tfbMainIsRunning
          True if analysis main loop is running.

Constructor Summary
TGo4Slave()
           
TGo4Slave(const char * name, Bool_t isserver, const char * serverhost, UInt_t negotport)
           

Destructor Summary
 virtual synchronized ~TGo4Slave()
           

Method Summary
 virtual TGo4TaskStatus*CreateStatus()
          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
 virtual voidExecuteString(const Text_t* command)
          Execute string command.
 TGo4ThreadHandler*GetThreadHandler()
           
 virtual Int_tInitialization()
          Overrides the ThreadManager Initialization; is used to setup the
client connections on demand; checks for fbConnectRequest flag
 virtual voidKillMain()
          Kill the main thread; method to be called from
command, should be overridden in user
implementation
 Bool_t&MainIsRunning()
           
 TGo4Command*NextCommand()
          Delivers next command from command queue.
 virtual voidRestartMain()
          Restart the main thread; method to be called from
command, should be overridden in user
implementation
 voidSendObject(TObject* obj, const char * receiver)
          Send object via data channel to the server.
 voidSendStatus(TGo4Status* stat, const char * receiver)
          Send status object via status channel to the server.
 voidSendStatusBuffer()
          Send internal status buffer to the server.
 voidSendStatusMessage(Int_t level, Bool_t printout, const char * text, ... )
          Send message string in a status object to the gui.
 virtual voidStart()
          General start method of slave application to be called from remote
command; should be re-implemented by application
 virtual voidStop()
          General stop method of slave application to be called from remote
command; should be re-implemented by application
 virtual voidTerminate(Bool_t termapp)
           
 virtual voidTerminateFast()
           
 protected virtual voidUpdateStatus(TGo4TaskStatus* state)
          method needed by method
CreateStatus of any status subclasses to
set the values of the clienttask specific
part of the status object.
 voidUpdateStatusBuffer()
          Create status object and stream it into the
status send buffer.

Methods inherited from class Go4TaskHandler.TGo4TaskOwner
GetName, GetTask, IsConnected, IsServer, Quit, SetTask, StartWorkThreads, StopWorkThreads

Field Detail

fbMainIsRunning

private Bool_t fbMainIsRunning
True if analysis main loop is running. If false, the slave main thread
will just wait on incoming commands without processing main loop.
Constructor Detail

TGo4Slave

public TGo4Slave()

TGo4Slave

public TGo4Slave(const char * name, Bool_t isserver, const char * serverhost, UInt_t negotport)
Method Detail

~TGo4Slave

public virtual synchronized ~TGo4Slave()
Method Detail

CreateStatus

public virtual TGo4TaskStatus* CreateStatus()
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

ExecuteString

public virtual void ExecuteString(const Text_t* command)
Execute string command. Uses gInterpreter by default. May be overridden
to evaluate go4 command strings in subclass.

GetThreadHandler

public TGo4ThreadHandler* GetThreadHandler()

Initialization

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

KillMain

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

MainIsRunning

public Bool_t& MainIsRunning()

NextCommand

public TGo4Command* NextCommand()
Delivers next command from command queue.

RestartMain

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

SendObject

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

SendStatus

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

SendStatusBuffer

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

SendStatusMessage

public void 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,

Start

public virtual void Start()
General start method of slave application to be called from remote
command; should be re-implemented by application

Stop

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

Terminate

public virtual void Terminate(Bool_t termapp)

TerminateFast

public virtual void TerminateFast()

UpdateStatus

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

UpdateStatusBuffer

public void 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.

J.Adamczewski, M.Al-Turany, D.Bertini, H.G.Essel, S.Linev

30-06-2005