GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
TGo4Task Class Reference

#include <TGo4Task.h>

+ Inheritance diagram for TGo4Task:

Public Member Functions

 TGo4Task (const char *name, Bool_t blockingmode, Bool_t autostart=kFALSE, Bool_t autocreate=kTRUE, Bool_t ismaster=kFALSE)
 
virtual ~TGo4Task ()
 
virtual void Start ()
 
virtual void Stop ()
 
virtual void Quit ()
 
virtual void KillMain ()
 
virtual void RestartMain ()
 
void Terminate (Bool_t termapp=kTRUE) override
 
void TerminateFast () override
 
virtual void ExecuteString (const char *command)
 
Bool_t IsMaster () const
 
void SetOwner (TGo4TaskOwner *owner)
 
virtual TGo4TaskHandlerGetTaskHandler ()
 
virtual TGo4BufferQueueGetCommandQueue (const char *task=nullptr)
 
virtual TGo4BufferQueueGetStatusQueue (const char *task=nullptr)
 
virtual TGo4BufferQueueGetDataQueue (const char *task=nullptr)
 
void AddUserCommand (TGo4Command *com)
 
void AddUserCommandList (TGo4CommandProtoList *comlist)
 
TGo4StatusNextStatus (Bool_t wait=kTRUE)
 
TObject * NextObject (Bool_t wait=kTRUE)
 
virtual TGo4CommandNextCommand ()
 
void SendObject (TObject *obj, const char *receiver=nullptr)
 
virtual void SendStatus (TGo4Status *stat, const char *receiver=nullptr)
 
virtual void SendStatusBuffer ()
 
TMutex * GetStatusBufferMutex ()
 
void SendStatusMessage (Int_t level, Bool_t printout, const char *text,...)
 
void UpdateStatusBuffer ()
 
Int_t Initialization () override
 
virtual TGo4TaskStatusCreateStatus ()
 
Bool_t SubmitCommand (const char *name)
 
Bool_t SubmitEmergencyCommand (Go4EmergencyCommand_t val)
 
Bool_t SubmitEmergencyData (Go4EmergencyCommand_t val, const char *receiver=nullptr)
 
Bool_t SubmitLocalCommand (TGo4Command *com)
 
Bool_t SubmitCommand (TGo4Command *com)
 
TGo4CommandMakeCommand (const char *name)
 
void WakeCommandQueue (Int_t id=0)
 
virtual Int_t StartWorkThreads ()
 
virtual Int_t StopWorkThreads ()
 
Bool_t IsWorkStopped () const
 
virtual void GetStatus ()
 
const char * GetCommanderName () const
 
TGo4MasterGetMaster () const
 
TGo4SlaveGetSlave () const
 
void SendStopBuffers (const char *taskname=nullptr)
 
TBuffer * GetAbortBuffer ()
 
- Public Member Functions inherited from TGo4ThreadManager
 TGo4ThreadManager (const TGo4ThreadManager &right)
 
 TGo4ThreadManager (const char *name, Bool_t blockingmode=kTRUE, Bool_t autostart=kTRUE, Bool_t autocreate=kTRUE)
 
virtual ~TGo4ThreadManager ()
 
void SetTimer (TGo4AppControlTimer *ctrltimer)
 
TGo4ThreadHandlerGetWorkHandler () const
 
Bool_t BlockApp ()
 
Bool_t UnBlockApp (Int_t mode=0)
 
Bool_t IsInitDone () const
 
Bool_t IsTerminating () const
 
Bool_t IsTerminateApp () const
 
Bool_t IsAppBlocking () const
 
Bool_t IsBeingQuit () const
 
void SetBeingQuit (Bool_t on)
 
void Launch ()
 
- Public Member Functions inherited from TGo4CommandReceiver
 TGo4CommandReceiver ()
 
virtual ~TGo4CommandReceiver ()
 

Static Public Member Functions

static Int_t Get_fgiTERMID ()
 

Protected Member Functions

virtual TGo4TaskHandlerCommandListCreateCommandList ()
 
TGo4TaskHandlerCommandListGetPrototype ()
 
virtual void UpdateStatus (TGo4TaskStatus *state)
 
TGo4ObjectQueueGetLocalCommandQueue ()
 
void SetMaster (Bool_t on=kTRUE)
 
void SetWorkIsStopped (Bool_t on)
 

Protected Attributes

TMutex * fxStatusMutex {nullptr}
 
TBuffer * fxStatusBuffer {nullptr}
 
- Protected Attributes inherited from TGo4ThreadManager
Bool_t fbInitDone {kFALSE}
 
Bool_t fbTerminating {kFALSE}
 
Bool_t fbTerminateApplication {kFALSE}
 
Bool_t fbAppBlocking {kFALSE}
 
Bool_t fbAutoCreate {kFALSE}
 
Bool_t fbAutoStart {kFALSE}
 
Int_t fbBeingQuit {0}
 
TGo4AppControlTimerfxBlocker {nullptr}
 
TGo4ThreadHandlerfxWorkHandler {nullptr}
 

Private Member Functions

void SetMaster (TGo4Master *m)
 
void SetSlave (TGo4Slave *s)
 

Private Attributes

TGo4TaskHandlerCommandListfxCommandPrototype {nullptr}
 
TGo4ObjectQueuefxLocalCommandQueue {nullptr}
 
Bool_t fbCommandMaster {kFALSE}
 
TString fxCommanderName
 
TGo4MasterfxMaster {nullptr}
 
TGo4SlavefxSlave {nullptr}
 
TGo4TaskOwnerfxOwner {nullptr}
 
Bool_t fbWorkIsStopped {kFALSE}
 
TBuffer * fxStopBuffer {nullptr}
 
TBuffer * fxQuitBuffer {nullptr}
 
TBuffer * fxAbortBuffer {nullptr}
 

Static Private Attributes

static const Int_t fgiTERMID =999
 

Friends

class TGo4LocalCommandRunnable
 
class TGo4Slave
 
class TGo4TaskOwner
 

Additional Inherited Members

- Public Types inherited from TGo4ThreadManager
enum  { fguTEXTLENGTH = 256 }
 
- Static Public Attributes inherited from TGo4ThreadManager
static const Long_t fglTIMERPERIOD = 200
 

Detailed Description

Definition at line 35 of file TGo4Task.h.

Constructor & Destructor Documentation

◆ TGo4Task()

TGo4Task::TGo4Task ( const char *  name,
Bool_t  blockingmode,
Bool_t  autostart = kFALSE,
Bool_t  autocreate = kTRUE,
Bool_t  ismaster = kFALSE 
)

◆ ~TGo4Task()

TGo4Task::~TGo4Task ( )
virtual

Member Function Documentation

◆ AddUserCommand()

void TGo4Task::AddUserCommand ( TGo4Command com)

Add a user command object to the existing command list. This can be done on the fly. Command receiver name of user command must match "Analysis", "AnalysisClient", or the name of the user analysis to be executed on the remote side.

Definition at line 206 of file TGo4Task.cxx.

References TGo4CommandProtoList::AddCommand(), and fxCommandPrototype.

Referenced by GetDataQueue().

◆ AddUserCommandList()

void TGo4Task::AddUserCommandList ( TGo4CommandProtoList comlist)

Add a user command list to the existing command list. This can be done on the fly. Commands of the user list are added to the existing command list.

Definition at line 211 of file TGo4Task.cxx.

References fxCommandPrototype.

Referenced by GetDataQueue().

◆ CreateCommandList()

TGo4TaskHandlerCommandList * TGo4Task::CreateCommandList ( )
protectedvirtual

factory method for command list; overridden by implementation

Reimplemented in TGo4ExampleServer.

Definition at line 497 of file TGo4Task.cxx.

Referenced by GetAbortBuffer(), Initialization(), and TGo4Task().

◆ CreateStatus()

TGo4TaskStatus * TGo4Task::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 TGo4ClientTask, and TGo4ExampleClient.

Definition at line 402 of file TGo4Task.cxx.

References UpdateStatus().

Referenced by GetStatus(), GetStatusBufferMutex(), and UpdateStatusBuffer().

◆ ExecuteString()

void TGo4Task::ExecuteString ( const char *  command)
virtual

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

Definition at line 146 of file TGo4Task.cxx.

References TGo4Slave::ExecuteString(), and fxSlave.

Referenced by TGo4ComExecLine::ExeCom().

◆ Get_fgiTERMID()

Int_t TGo4Task::Get_fgiTERMID ( )
static

◆ GetAbortBuffer()

TBuffer* TGo4Task::GetAbortBuffer ( )
inline

Use preallocated abort buffer to stop remote socket wait from taskhandler itself

Definition at line 272 of file TGo4Task.h.

References CreateCommandList(), fxAbortBuffer, Get_fgiTERMID(), GetPrototype(), and UpdateStatus().

◆ GetCommanderName()

const char* TGo4Task::GetCommanderName ( ) const
inline

Definition at line 255 of file TGo4Task.h.

References fxCommanderName.

Referenced by Initialization(), SubmitLocalCommand(), and TGo4Task().

◆ GetCommandQueue()

virtual TGo4BufferQueue* TGo4Task::GetCommandQueue ( const char *  task = nullptr)
inlinevirtual

◆ GetDataQueue()

virtual TGo4BufferQueue* TGo4Task::GetDataQueue ( const char *  task = nullptr)
inlinevirtual

◆ GetLocalCommandQueue()

TGo4ObjectQueue* TGo4Task::GetLocalCommandQueue ( )
inlineprotected

Definition at line 292 of file TGo4Task.h.

References fxLocalCommandQueue.

Referenced by TGo4LocalCommandRunnable::Run(), and SubmitLocalCommand().

◆ GetMaster()

TGo4Master* TGo4Task::GetMaster ( ) const
inline

Definition at line 257 of file TGo4Task.h.

References fxMaster.

Referenced by TGo4TaskHandlerAbortException::Handle().

◆ GetPrototype()

TGo4TaskHandlerCommandList * TGo4Task::GetPrototype ( )
protected

get pointer to currently valid command list

Definition at line 154 of file TGo4Task.cxx.

References fxCommandPrototype.

Referenced by GetAbortBuffer().

◆ GetSlave()

TGo4Slave* TGo4Task::GetSlave ( ) const
inline

◆ GetStatus()

void TGo4Task::GetStatus ( )
virtual

Send current status information of the task to the master; may be re-implemented by application subclass of TGo4Task

Definition at line 536 of file TGo4Task.cxx.

References TGo4BufferQueue::AddBufferFromObject(), CreateStatus(), TGo4Log::Debug(), and GetStatusQueue().

Referenced by IsWorkStopped().

◆ GetStatusBufferMutex()

TMutex* TGo4Task::GetStatusBufferMutex ( )
inline

Access to the mutex of status buffer. To be locked outside any command, otherwise deadlocking possible

Definition at line 154 of file TGo4Task.h.

References CreateStatus(), fxStatusMutex, Initialization(), MakeCommand(), SendStatusMessage(), StartWorkThreads(), StopWorkThreads(), SubmitCommand(), SubmitEmergencyCommand(), SubmitEmergencyData(), SubmitLocalCommand(), UpdateStatusBuffer(), and WakeCommandQueue().

Referenced by TGo4AnalysisMainRunnable::Run().

◆ GetStatusQueue()

virtual TGo4BufferQueue* TGo4Task::GetStatusQueue ( const char *  task = nullptr)
inlinevirtual

Reimplemented in TGo4ClientTask, and TGo4ServerTask.

Definition at line 103 of file TGo4Task.h.

Referenced by GetStatus(), NextStatus(), SendStatus(), SendStatusBuffer(), and SendStopBuffers().

◆ GetTaskHandler()

virtual TGo4TaskHandler* TGo4Task::GetTaskHandler ( )
inlinevirtual

Reimplemented in TGo4ClientTask, and TGo4ServerTask.

Definition at line 99 of file TGo4Task.h.

Referenced by TGo4AnalysisProxy::GetRole(), SendStopBuffers(), UpdateStatus(), and WakeCommandQueue().

◆ Initialization()

Int_t TGo4Task::Initialization ( )
overridevirtual

◆ IsMaster()

Bool_t TGo4Task::IsMaster ( ) const
inline

◆ IsWorkStopped()

Bool_t TGo4Task::IsWorkStopped ( ) const
inline

Definition at line 246 of file TGo4Task.h.

References fbWorkIsStopped, and GetStatus().

Referenced by TGo4ServerTask::SetCurrentTask().

◆ KillMain()

void TGo4Task::KillMain ( )
virtual

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

Definition at line 120 of file TGo4Task.cxx.

References fxSlave, and TGo4Slave::KillMain().

Referenced by TGo4CommandRunnable::Run().

◆ MakeCommand()

TGo4Command * TGo4Task::MakeCommand ( const char *  name)

Method using internal command prototype list to produce a clone of the specified command

Definition at line 502 of file TGo4Task.cxx.

References fxCommandPrototype, and TGo4CommandProtoList::MakeCommand().

Referenced by GetStatusBufferMutex(), and SubmitCommand().

◆ NextCommand()

TGo4Command * TGo4Task::NextCommand ( )
virtual

◆ NextObject()

TObject * TGo4Task::NextObject ( Bool_t  wait = kTRUE)

Delivers next object from data queue. Encapsulates the queue wait and the object streaming. Streamer is decoupled from queue wait and sets global lockguard. If wait=kFALSE, queue will be polled once instead of condition wait.

Definition at line 189 of file TGo4Task.cxx.

References GetDataQueue(), TGo4Queue::IsEmpty(), IsMaster(), and TGo4BufferQueue::WaitObjectFromBuffer().

Referenced by GetDataQueue(), TGo4DisplayDrawerTimer::Notify(), and TGo4ControllerRunnable::Run().

◆ NextStatus()

TGo4Status * TGo4Task::NextStatus ( Bool_t  wait = kTRUE)

Delivers next status object from status queue. Encapsulates the queue wait and the object streaming. Streamer is decoupled from queue wait and sets global lockguard. If wait=kFALSE, queue will be polled once instead of condition wait.

Definition at line 160 of file TGo4Task.cxx.

References TGo4Log::Debug(), GetStatusQueue(), TGo4Queue::IsEmpty(), IsMaster(), and TGo4BufferQueue::WaitObjectFromBuffer().

Referenced by GetDataQueue(), TGo4DisplayLoggerTimer::Notify(), and TGo4LoggingRunnable::Run().

◆ Quit()

void TGo4Task::Quit ( )
virtual

Quit the client; method to be called from command object, may be overridden in user implementation

Reimplemented in TGo4ClientTask, and TGo4ServerTask.

Definition at line 115 of file TGo4Task.cxx.

References fxSlave, and TGo4TaskOwner::Quit().

Referenced by TGo4ComQuit::ExeCom(), TGo4TaskOwner::Quit(), and TGo4ClientTask::Quit().

◆ RestartMain()

void TGo4Task::RestartMain ( )
virtual

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

Definition at line 125 of file TGo4Task.cxx.

References fxSlave, and TGo4Slave::RestartMain().

Referenced by TGo4CommandRunnable::Run().

◆ SendObject()

void TGo4Task::SendObject ( TObject *  obj,
const char *  receiver = nullptr 
)

Send object via data channel to the master. Master name may be specified, if more than one master is connected. By default, object is send to current active task

Definition at line 222 of file TGo4Task.cxx.

References TGo4BufferQueue::AddBufferFromObject(), TGo4Log::Debug(), GetDataQueue(), IsMaster(), and SendStatusMessage().

Referenced by GetDataQueue(), and TGo4Slave::SendObject().

◆ SendStatus()

void TGo4Task::SendStatus ( TGo4Status stat,
const char *  receiver = nullptr 
)
virtual

Send status object via status channel to the master. Master name may be specified, if more than one master is connected. By default, object is send to all connected tasks

Reimplemented in TGo4ServerTask.

Definition at line 246 of file TGo4Task.cxx.

References TGo4BufferQueue::AddBufferFromObject(), TGo4Log::Debug(), GetStatusQueue(), and IsMaster().

Referenced by GetDataQueue(), TGo4ServerTask::SendStatus(), TGo4Slave::SendStatus(), and SendStatusMessage().

◆ SendStatusBuffer()

void TGo4Task::SendStatusBuffer ( )
virtual

Send internal status buffer to the master(s).

Reimplemented in TGo4ServerTask.

Definition at line 263 of file TGo4Task.cxx.

References TGo4BufferQueue::AddBuffer(), TGo4Log::Debug(), fxStatusBuffer, fxStatusMutex, GetStatusQueue(), and IsMaster().

Referenced by GetDataQueue(), TGo4WatchRunnable::Run(), and TGo4Slave::SendStatusBuffer().

◆ SendStatusMessage()

void TGo4Task::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. Message text may begin with name of receiver for message, followed by "::". If no receiver is defined, all connected masters will receive message (default).

Definition at line 272 of file TGo4Task.cxx.

References go4init::args, IsMaster(), TGo4Log::IsOutputEnabled(), TGo4Log::Message(), TGo4Log::OutputEnable(), and SendStatus().

Referenced by TGo4TaskManager::AddClient(), TGo4ClientTask::ConnectServer(), TGo4ComExecLine::ExeCom(), TGo4ComStart::ExeCom(), TGo4ComStop::ExeCom(), GetStatusBufferMutex(), TGo4ServerTask::Quit(), TGo4ClientTask::Quit(), TGo4TaskHandlerCommand::RefuseCom(), TGo4WatchRunnable::Run(), SendObject(), TGo4Slave::SendStatusMessage(), and TGo4ServerTask::Shutdown().

◆ SendStopBuffers()

void TGo4Task::SendStopBuffers ( const char *  taskname = nullptr)

Send message buffers with stop values into queues and via socket connections. Used in disconnect procedure to put taskhandler threads into suspend mode, i.e. wake them from socket receive or queue wait. For multiple client connection, taskname defines which client to stop.

Definition at line 560 of file TGo4Task.cxx.

References TGo4BufferQueue::AddBuffer(), fxStopBuffer, GetCommandQueue(), GetDataQueue(), GetStatusQueue(), GetTaskHandler(), TGo4TaskHandler::IsAborting(), and IsMaster().

Referenced by TGo4TaskManager::DisConnectClient(), TGo4ClientTask::DisconnectServer(), GetSlave(), and TGo4ServerTask::RemoveClient().

◆ SetMaster() [1/2]

void TGo4Task::SetMaster ( Bool_t  on = kTRUE)
inlineprotected

Definition at line 294 of file TGo4Task.h.

References fbCommandMaster.

Referenced by SetMaster(), SetOwner(), SetSlave(), and TGo4ExampleClient::TGo4ExampleClient().

◆ SetMaster() [2/2]

void TGo4Task::SetMaster ( TGo4Master m)
private

Definition at line 86 of file TGo4Task.cxx.

References fxMaster, and SetMaster().

◆ SetOwner()

void TGo4Task::SetOwner ( TGo4TaskOwner owner)

Set owner object and switch automatically in master or slave mode, depending on owner type

Definition at line 98 of file TGo4Task.cxx.

References fxOwner, SetMaster(), and SetSlave().

Referenced by IsMaster(), TGo4TaskOwner::SetTask(), and TGo4TaskOwner::~TGo4TaskOwner().

◆ SetSlave()

void TGo4Task::SetSlave ( TGo4Slave s)
private

Definition at line 92 of file TGo4Task.cxx.

References fxSlave, and SetMaster().

Referenced by SetOwner().

◆ SetWorkIsStopped()

void TGo4Task::SetWorkIsStopped ( Bool_t  on)
inlineprotected

Definition at line 296 of file TGo4Task.h.

References fbWorkIsStopped.

Referenced by TGo4TaskOwner::StartWorkThreads(), and TGo4TaskOwner::StopWorkThreads().

◆ Start()

void TGo4Task::Start ( )
virtual

General start method of client application to be called from remote command; should be re-implemented by application

Reimplemented in TGo4ExampleClient.

Definition at line 105 of file TGo4Task.cxx.

References fxSlave, and TGo4Slave::Start().

Referenced by TGo4ComStart::ExeCom().

◆ StartWorkThreads()

Int_t TGo4Task::StartWorkThreads ( )
virtual

start the working threads of the task implementation; this method is used after the current connection has changed, to continue reading/writing the queues. To be overridden by the derived task.

Reimplemented in TGo4ExampleServer.

Definition at line 548 of file TGo4Task.cxx.

References fbWorkIsStopped, fxOwner, and TGo4TaskOwner::StartWorkThreads().

Referenced by TGo4ClientTask::DisconnectServer(), GetStatusBufferMutex(), TGo4ServerTask::RemoveClient(), TGo4TaskManager::RemoveTaskHandler(), TGo4ServerTask::SetCurrentTask(), and TGo4ExampleServer::StartWorkThreads().

◆ Stop()

void TGo4Task::Stop ( )
virtual

General stop method of client application to be called from remote command; should be re-implemented by application

Reimplemented in TGo4ExampleClient.

Definition at line 110 of file TGo4Task.cxx.

References fxSlave, and TGo4Slave::Stop().

Referenced by TGo4ComStop::ExeCom().

◆ StopWorkThreads()

Int_t TGo4Task::StopWorkThreads ( )
virtual

stop the working threads of the task implementation; this method is used before the current connection is changed to prevent reading/writing and waiting for the wrong queues. To be overridden by the derived task.

Reimplemented in TGo4ExampleServer.

Definition at line 554 of file TGo4Task.cxx.

References fbWorkIsStopped, fxOwner, and TGo4TaskOwner::StopWorkThreads().

Referenced by TGo4ClientTask::DisconnectServer(), GetStatusBufferMutex(), TGo4ServerTask::RemoveClient(), TGo4ServerTask::SetCurrentTask(), TGo4ServerTask::Shutdown(), and TGo4ExampleServer::StopWorkThreads().

◆ SubmitCommand() [1/2]

Bool_t TGo4Task::SubmitCommand ( const char *  name)

◆ SubmitCommand() [2/2]

Bool_t TGo4Task::SubmitCommand ( TGo4Command com)

send given command to the current client task. Command object is deleted after this call internally!

Definition at line 476 of file TGo4Task.cxx.

References TGo4BufferQueue::AddBufferFromObject(), GetCommandQueue(), TGo4Command::IsLocal(), and SubmitLocalCommand().

◆ SubmitEmergencyCommand()

Bool_t TGo4Task::SubmitEmergencyCommand ( Go4EmergencyCommand_t  val)

◆ SubmitEmergencyData()

Bool_t TGo4Task::SubmitEmergencyData ( Go4EmergencyCommand_t  val,
const char *  receiver = nullptr 
)

Send emergency command via data channel. For analysis server shutdown, to inform clients about disconnect

Definition at line 455 of file TGo4Task.cxx.

References TGo4BufferQueue::AddBuffer(), TGo4BufferQueue::CreateValueBuffer(), fxQuitBuffer, GetDataQueue(), and kComQuit.

Referenced by GetStatusBufferMutex(), and TGo4ServerTask::RemoveClient().

◆ SubmitLocalCommand()

Bool_t TGo4Task::SubmitLocalCommand ( TGo4Command com)

◆ Terminate()

void TGo4Task::Terminate ( Bool_t  termapp = kTRUE)
overridevirtual

deletes the Manager instance via Control timer. If termap is true, also terminates the root Application

Reimplemented from TGo4ThreadManager.

Definition at line 130 of file TGo4Task.cxx.

References fxSlave, TGo4Slave::Terminate(), and TGo4ThreadManager::Terminate().

Referenced by TGo4Master::DisconnectSlave(), TGo4ClientTask::Initialization(), TGo4ServerTask::Quit(), and TGo4ClientTask::Quit().

◆ TerminateFast()

void TGo4Task::TerminateFast ( )
overridevirtual

Overwrites the Threadmanager TerminateFast to shutdown the objectserver properly

Reimplemented from TGo4ThreadManager.

Definition at line 138 of file TGo4Task.cxx.

References fxSlave, TGo4Slave::TerminateFast(), and TGo4ThreadManager::TerminateFast().

Referenced by TGo4TaskHandlerAbortException::Handle().

◆ UpdateStatus()

void TGo4Task::UpdateStatus ( TGo4TaskStatus state)
protectedvirtual

◆ UpdateStatusBuffer()

void TGo4Task::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 308 of file TGo4Task.cxx.

References TGo4Slave::CreateStatus(), CreateStatus(), fxSlave, fxStatusBuffer, fxStatusMutex, IsMaster(), and main().

Referenced by GetStatusBufferMutex(), TGo4WatchRunnable::Run(), and TGo4Slave::UpdateStatusBuffer().

◆ WakeCommandQueue()

void TGo4Task::WakeCommandQueue ( Int_t  id = 0)

Put dummy object into command queue to wake up user threads which might wait for a command. To be used in quit and restart methods. Id can set in such way that application can check the command id for special action, e.g. stop thread in case of termination.

Definition at line 522 of file TGo4Task.cxx.

References GetTaskHandler(), TGo4TaskHandler::IsAborting(), SubmitCommand(), and SubmitLocalCommand().

Referenced by TGo4ClientTask::DisconnectServer(), GetStatusBufferMutex(), TGo4AnalysisClient::KillMain(), TGo4ServerTask::Quit(), TGo4AnalysisClient::RestartMain(), and TGo4ServerTask::Shutdown().

Friends And Related Function Documentation

◆ TGo4LocalCommandRunnable

friend class TGo4LocalCommandRunnable
friend

Definition at line 38 of file TGo4Task.h.

Referenced by TGo4Task().

◆ TGo4Slave

friend class TGo4Slave
friend

Definition at line 39 of file TGo4Task.h.

◆ TGo4TaskOwner

friend class TGo4TaskOwner
friend

Definition at line 40 of file TGo4Task.h.

Member Data Documentation

◆ fbCommandMaster

Bool_t TGo4Task::fbCommandMaster {kFALSE}
private

This flag indicates the main state of the task: either master (sends commands, receives data and status), or slave (receives commands and may send date and status)

Definition at line 319 of file TGo4Task.h.

Referenced by IsMaster(), and SetMaster().

◆ fbWorkIsStopped

Bool_t TGo4Task::fbWorkIsStopped {kFALSE}
private

True if user work threads are stopped for connection change

Definition at line 334 of file TGo4Task.h.

Referenced by IsWorkStopped(), SetWorkIsStopped(), StartWorkThreads(), and StopWorkThreads().

◆ fgiTERMID

const Int_t TGo4Task::fgiTERMID =999
staticprivate

Id number of dummy command that wakes the command queue on termination

Definition at line 346 of file TGo4Task.h.

Referenced by Get_fgiTERMID().

◆ fxAbortBuffer

TBuffer* TGo4Task::fxAbortBuffer {nullptr}
private

this buffer is used for emergency socket aborting

Definition at line 343 of file TGo4Task.h.

Referenced by GetAbortBuffer(), and TGo4Task().

◆ fxCommanderName

TString TGo4Task::fxCommanderName
private

remember name of localcommand thread

Definition at line 322 of file TGo4Task.h.

Referenced by GetCommanderName(), and TGo4Task().

◆ fxCommandPrototype

TGo4TaskHandlerCommandList* TGo4Task::fxCommandPrototype {nullptr}
private

the command list which holds all command prototypes

Definition at line 311 of file TGo4Task.h.

Referenced by AddUserCommand(), AddUserCommandList(), GetPrototype(), Initialization(), MakeCommand(), and ~TGo4Task().

◆ fxLocalCommandQueue

TGo4ObjectQueue* TGo4Task::fxLocalCommandQueue {nullptr}
private

queue for the server side local commands, submitted by the gui or cli

Definition at line 314 of file TGo4Task.h.

Referenced by GetLocalCommandQueue(), TGo4Task(), and ~TGo4Task().

◆ fxMaster

TGo4Master* TGo4Task::fxMaster {nullptr}
private

0..1

Definition at line 325 of file TGo4Task.h.

Referenced by GetMaster(), Initialization(), and SetMaster().

◆ fxOwner

TGo4TaskOwner* TGo4Task::fxOwner {nullptr}
private

0..1

Definition at line 331 of file TGo4Task.h.

Referenced by SetOwner(), StartWorkThreads(), StopWorkThreads(), and ~TGo4Task().

◆ fxQuitBuffer

TBuffer* TGo4Task::fxQuitBuffer {nullptr}
private

this buffer is used for quit command

Definition at line 340 of file TGo4Task.h.

Referenced by SubmitEmergencyCommand(), SubmitEmergencyData(), TGo4Task(), and ~TGo4Task().

◆ fxSlave

TGo4Slave* TGo4Task::fxSlave {nullptr}
private

◆ fxStatusBuffer

TBuffer* TGo4Task::fxStatusBuffer {nullptr}
protected

Buffer containing the analysis status which is updated by the main thread

Definition at line 302 of file TGo4Task.h.

Referenced by TGo4ServerTask::SendStatusBuffer(), SendStatusBuffer(), TGo4Task(), UpdateStatusBuffer(), and ~TGo4Task().

◆ fxStatusMutex

TMutex* TGo4Task::fxStatusMutex {nullptr}
protected

Mutex protecting status buffer between main and watch thread.

Definition at line 299 of file TGo4Task.h.

Referenced by GetStatusBufferMutex(), TGo4ServerTask::SendStatusBuffer(), SendStatusBuffer(), TGo4Task(), UpdateStatusBuffer(), and ~TGo4Task().

◆ fxStopBuffer

TBuffer* TGo4Task::fxStopBuffer {nullptr}
private

this buffer is used for stop message for threads

Definition at line 337 of file TGo4Task.h.

Referenced by SendStopBuffers(), TGo4Task(), and ~TGo4Task().


The documentation for this class was generated from the following files: