#include <TGo4AnalysisClientImp.h>
Inheritance diagram for TGo4AnalysisClient:
Public Member Functions | |
TGo4AnalysisClient (const char *name, TGo4Analysis *analysis, const char *host="localhost", UInt_t negport=0, Bool_t histoserver=kFALSE, const char *basename="Go4", const char *passwd="abcd", Bool_t servermode=kFALSE, Bool_t autorun=kFALSE, Bool_t clientmode=kFALSE) | |
TGo4AnalysisClient (int argc, char **argv, TGo4Analysis *analysis, Bool_t histoserver=kFALSE, const char *basename="Go4", const char *passwd="abcd", Bool_t servermode=kFALSE, Bool_t autorun=kFALSE) | |
virtual | ~TGo4AnalysisClient () |
TGo4Analysis * | GetAnalysis () const |
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 | KillMain () |
Kill the main thread; method to be called from command, should be overridden in user implementation. | |
virtual void | RestartMain () |
Restart the main thread; method to be called from command, should be overridden in user implementation. | |
virtual TGo4TaskStatus * | CreateStatus () |
create a status object with information on the current client state. | |
virtual Int_t | Initialization () |
Override the ClientTask/ThreadManager Initialization used by AppControlTimer to init event classes before the threads are started. | |
void | SendAnalysisObject (const Text_t *name) |
Fetch object of name from analysis instance and put it into the data queue of the client. | |
void | SendAnalysisStatus () |
Send a complete status object of the analysis via the status queue. | |
void | SendAnalysisClientStatus () |
Send a complete status object of the analysis client via the status queue. | |
void | SendNamesList () |
Send the list of object names (folder structure) as status object to the gui. | |
void | UpdateRate (Int_t counts=1) |
Update ratemeter. | |
UInt_t | GetCurrentCount () |
Number of currently processed events since last start. | |
Bool_t | TestRatemeter () |
Test if ratemeter has been updated. | |
Bool_t | TestBufferUpdateConditions () |
Test if status buffer shall be updated now. | |
void | StartObjectServer (const Text_t *basename, const Text_t *passwd) |
Start the object (histogram) server. | |
void | StopObjectServer () |
Stop the object (histogram) server. | |
virtual Int_t | StartWorkThreads () |
start the working threads of the slave implementation; | |
virtual Int_t | StopWorkThreads () |
stop the working threads of the slave implementation; | |
virtual void | Terminate (Bool_t termapp=kTRUE) |
Overwrites the Threadmanager Terminate to shutdown the objectserver properly. | |
virtual void | TerminateFast () |
Overwrites the Threadmanager TerminateFast to shutdown the objectserver properly. | |
virtual void | ExecuteString (const Text_t *command) |
Execute string command. | |
void | SetCintMode (Bool_t on=kTRUE) |
Bool_t & | IsCintMode () |
void | LockAll () |
Lock all go4 mutexes in correct order to avoid deadlocking. | |
void | UnLockAll () |
UnLock all go4 mutexes in correct order to avoid deadlocking to be used from cintlocktimer. | |
Static Public Attributes | |
static const Text_t | fgcMAINTHREAD [] = "MAIN-" |
suffix for main thread name | |
static const Text_t | fgcWATCHTHREAD [] = "WATCH-" |
suffix for watch thread name | |
static const UInt_t | fguSTATUSUPDATE = 1000 |
Number of mainloop runs between two updates of the client status object. | |
static const Double_t | fgdSTATUSTIMEOUT = 2 |
Maximum time (in s) between two updates of the client status object. | |
static const UInt_t | fguCINTTIMERPERIOD = 200 |
Timer period (in ms) for cint locking timer. | |
Private Member Functions | |
void | Constructor (Bool_t starthistserv=kFALSE, const char *basename="Go4", const char *passwd="abcd") |
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. | |
TGo4AnalysisClient () | |
Private Attributes | |
TGo4Analysis * | fxAnalysis |
The analysis the client is working on. | |
Text_t * | fcMainName |
remember name of main thread | |
Text_t * | fcWatchName |
remember name of watch thread | |
Double_t | fdBufferUpdateTime |
absoulute time of the last status buffer update. | |
TStopwatch * | fxUpdateWatch |
Stopwatch controlling the buffer update time. | |
TGo4Ratemeter * | fxRatemeter |
1 | |
TGo4HistogramServer * | fxHistoServer |
1 histogram server (optional) | |
Bool_t | fbAutoStart |
If true, this slave will initialize and start analysis immediately without waiting for a submit/start command. | |
Bool_t | fbCintMode |
If true, this slave runs to control CINT macro. | |
TTimer * | fxCintLockTimer |
For cintmode, we only allow to release the main lock within a certain time window, triggered by this timer. | |
TGo4InterruptHandler * | fxInterruptHandler |
use to treat Ctrl-C interrupts in CINT mode |
Definition at line 35 of file TGo4AnalysisClientImp.h.
|
Definition at line 88 of file TGo4AnalysisClientImp.cxx. References Constructor(), TGo4Log::Debug(), fxAnalysis, fxInterruptHandler, TGo4TaskOwner::GetName(), TGo4Analysis::Instance(), TGo4Analysis::SetAnalysisClient(), SetCintMode(), and TRACE. |
|
Definition at line 128 of file TGo4AnalysisClientImp.cxx. References Constructor(), TGo4Log::Debug(), TGo4Log::Error(), fxAnalysis, TGo4TaskOwner::GetName(), TGo4Analysis::Instance(), TGo4Analysis::SetAnalysisClient(), and TRACE. |
|
Definition at line 196 of file TGo4AnalysisClientImp.cxx. References fcMainName, fcWatchName, fxAnalysis, fxCintLockTimer, fxInterruptHandler, fxRatemeter, fxUpdateWatch, TGo4Slave::GetThreadHandler(), TGo4Analysis::LockAutoSave(), StopObjectServer(), TRACE, TGo4Analysis::UnLockAutoSave(), and TGo4CommandInvoker::UnRegister(). |
|
|
|
Definition at line 59 of file TGo4AnalysisClientImp.h. References fxAnalysis. Referenced by SendAnalysisStatus(), TGo4AnalysisMainRunnable::TGo4AnalysisMainRunnable(), TGo4AnalysisWatchRunnable::TGo4AnalysisWatchRunnable(), and TGo4HistogramServer::TGo4HistogramServer(). |
|
General start method of slave application to be called from remote command; should be re-implemented by application.
Reimplemented from TGo4Slave. Definition at line 335 of file TGo4AnalysisClientImp.cxx. References fcMainName, fdBufferUpdateTime, fxAnalysis, fxRatemeter, fxUpdateWatch, TGo4TaskOwner::GetName(), TGo4Slave::GetThreadHandler(), TGo4Analysis::IsInitDone(), TGo4Slave::MainIsRunning(), TGo4Analysis::PreLoop(), TGo4Ratemeter::Reset(), SendAnalysisClientStatus(), TGo4Slave::SendStatusMessage(), TGo4Slave::Start(), TRACE, UpdateRate(), and TGo4Slave::UpdateStatusBuffer(). Referenced by Initialization(), and TGo4Analysis::SetRunning(). |
|
General stop method of slave application to be called from remote command; should be re-implemented by application.
Reimplemented from TGo4Slave. Definition at line 440 of file TGo4AnalysisClientImp.cxx. References fxAnalysis, TGo4TaskOwner::GetName(), TGo4TaskOwner::GetTask(), TGo4Slave::MainIsRunning(), TGo4Analysis::PostLoop(), SendAnalysisClientStatus(), TGo4Slave::SendStatusMessage(), TGo4Slave::Stop(), TRACE, UpdateRate(), and TGo4Slave::UpdateStatusBuffer(). Referenced by TGo4Analysis::Process(), TGo4AnalysisMainRunnable::Run(), and TGo4Analysis::SetRunning(). |
|
Kill the main thread; method to be called from command, should be overridden in user implementation.
Reimplemented from TGo4Slave. Definition at line 415 of file TGo4AnalysisClientImp.cxx. References fcMainName, TGo4TaskOwner::GetName(), TGo4TaskOwner::GetTask(), TGo4Slave::GetThreadHandler(), TGo4Slave::SendStatusMessage(), and TRACE. |
|
Restart the main thread; method to be called from command, should be overridden in user implementation.
Reimplemented from TGo4Slave. Definition at line 425 of file TGo4AnalysisClientImp.cxx. References fcMainName, fxRatemeter, TGo4TaskOwner::GetName(), TGo4TaskOwner::GetTask(), TGo4Slave::GetThreadHandler(), TGo4Ratemeter::Reset(), TGo4Slave::SendStatusMessage(), and TRACE. |
|
create a status object with information on the current client state. this object may be sent to the server or may be used to restore current status by memento mechanism. Overridden from superclass Reimplemented from TGo4Slave. Definition at line 326 of file TGo4AnalysisClientImp.cxx. References TGo4TaskOwner::GetName(), TRACE, and UpdateStatus(). |
|
Override the ClientTask/ThreadManager Initialization used by AppControlTimer to init event classes before the threads are started.
Reimplemented from TGo4Slave. Definition at line 231 of file TGo4AnalysisClientImp.cxx. References fbAutoStart, TGo4Analysis::fgcDEFAULTSTATUSFILENAME, fxAnalysis, TGo4TaskOwner::GetName(), TGo4Analysis::InitEventClasses(), IsCintMode(), TGo4Analysis::LoadObjects(), TGo4Analysis::LoadStatus(), SendAnalysisClientStatus(), SendAnalysisStatus(), TGo4Slave::SendStatusMessage(), Start(), TGo4Slave::Stop(), and TGo4Slave::UpdateStatusBuffer(). |
|
Fetch object of name from analysis instance and put it into the data queue of the client. Send an error status object via status queue if there is no such object. Definition at line 359 of file TGo4AnalysisClientImp.cxx. References fxAnalysis, TGo4Analysis::GetObject(), TGo4Slave::SendObject(), and TRACE. |
|
Send a complete status object of the analysis via the status queue.
Definition at line 366 of file TGo4AnalysisClientImp.cxx. References TGo4Analysis::CreateStatus(), TGo4Log::Debug(), GetAnalysis(), TGo4Slave::SendStatus(), TGo4Slave::SendStatusMessage(), and TRACE. Referenced by Initialization(). |
|
Send a complete status object of the analysis client via the status queue.
Definition at line 384 of file TGo4AnalysisClientImp.cxx. References TGo4Log::Debug(), TGo4Slave::SendStatusBuffer(), and TRACE. Referenced by Initialization(), TGo4AnalysisWatchRunnable::Run(), Start(), and Stop(). |
|
Send the list of object names (folder structure) as status object to the gui.
Definition at line 397 of file TGo4AnalysisClientImp.cxx. References TGo4Log::Debug(), fxAnalysis, TGo4Analysis::GetNamesList(), TGo4Slave::SendObject(), TGo4Slave::SendStatusMessage(), TRACE, and TGo4Analysis::UpdateNamesList(). |
|
Update ratemeter. To be used from main thread. Definition at line 454 of file TGo4AnalysisClientImp.cxx. References fxRatemeter, TRACE, and TGo4Ratemeter::Update(). Referenced by TGo4Analysis::MainCycle(), TGo4AnalysisWatchRunnable::Run(), Start(), and Stop(). |
|
Number of currently processed events since last start.
Definition at line 459 of file TGo4AnalysisClientImp.cxx. References fxRatemeter, and TGo4Ratemeter::GetCurrentCount(). Referenced by TestBufferUpdateConditions(). |
|
Test if ratemeter has been updated.
Definition at line 464 of file TGo4AnalysisClientImp.cxx. References fxRatemeter, and TGo4Ratemeter::TestUpdate(). Referenced by TGo4AnalysisWatchRunnable::Run(). |
|
Test if status buffer shall be updated now.
Definition at line 469 of file TGo4AnalysisClientImp.cxx. References fdBufferUpdateTime, fgdSTATUSTIMEOUT, fguSTATUSUPDATE, fxUpdateWatch, and GetCurrentCount(). Referenced by TGo4Analysis::MainCycle(). |
|
Start the object (histogram) server. Existing server will be stopped and replaced by new server with different basename and password. Definition at line 489 of file TGo4AnalysisClientImp.cxx. References fxHistoServer, and StopObjectServer(). Referenced by Constructor(), and ExecuteString(). |
|
Stop the object (histogram) server.
Definition at line 499 of file TGo4AnalysisClientImp.cxx. References fxHistoServer. Referenced by ExecuteString(), StartObjectServer(), Terminate(), TerminateFast(), and ~TGo4AnalysisClient(). |
|
start the working threads of the slave implementation;
Reimplemented from TGo4TaskOwner. Definition at line 581 of file TGo4AnalysisClientImp.cxx. References fcMainName, fcWatchName, TGo4Slave::GetThreadHandler(), and TGo4TaskOwner::StartWorkThreads(). |
|
stop the working threads of the slave implementation;
Reimplemented from TGo4TaskOwner. Definition at line 593 of file TGo4AnalysisClientImp.cxx. References fcMainName, fcWatchName, TGo4Slave::GetThreadHandler(), and TGo4TaskOwner::StopWorkThreads(). |
|
Overwrites the Threadmanager Terminate to shutdown the objectserver properly.
Reimplemented from TGo4Slave. Definition at line 511 of file TGo4AnalysisClientImp.cxx. References TGo4TaskOwner::GetTask(), SetCintMode(), and StopObjectServer(). |
|
Overwrites the Threadmanager TerminateFast to shutdown the objectserver properly.
Reimplemented from TGo4Slave. Definition at line 519 of file TGo4AnalysisClientImp.cxx. References TGo4Log::Debug(), fcMainName, fcWatchName, fxAnalysis, TGo4TaskOwner::GetTask(), TGo4Slave::GetThreadHandler(), and StopObjectServer(). |
|
Execute string command. Overrides base class implementation to decouple some commands from analysis client. Reimplemented from TGo4Slave. Definition at line 536 of file TGo4AnalysisClientImp.cxx. References TGo4Slave::ExecuteString(), TGo4ThreadManager::fguTEXTLENGTH, StartObjectServer(), and StopObjectServer(). |
|
Definition at line 605 of file TGo4AnalysisClientImp.cxx. References fbCintMode, fguCINTTIMERPERIOD, fxAnalysis, fxCintLockTimer, and TGo4Analysis::SetAutoSave(). Referenced by main(), Terminate(), and TGo4AnalysisClient(). |
|
Definition at line 141 of file TGo4AnalysisClientImp.h. References fbCintMode. Referenced by Initialization(), and TGo4AnalysisMainRunnable::Run(). |
|
Lock all go4 mutexes in correct order to avoid deadlocking. to be used from cintlocktimer Definition at line 635 of file TGo4AnalysisClientImp.cxx. References TGo4TaskOwner::GetTask(), and TGo4Task::LockAll(). Referenced by TGo4CintLockTimer::Notify(). |
|
UnLock all go4 mutexes in correct order to avoid deadlocking to be used from cintlocktimer.
Definition at line 641 of file TGo4AnalysisClientImp.cxx. References TGo4TaskOwner::GetTask(), and TGo4Task::UnLockAll(). Referenced by TGo4CintLockTimer::Notify(), and TGo4CintLockTimer::~TGo4CintLockTimer(). |
|
|
Method needed by method CreateStatus of any status subclasses to set the values of the clienttask specific part of the status object.
Reimplemented from TGo4Slave. Definition at line 299 of file TGo4AnalysisClientImp.cxx. References fxAnalysis, fxRatemeter, TGo4Analysis::GetAnalysisStep(), TGo4Ratemeter::GetAvRate(), TGo4Ratemeter::GetCurrentCount(), TGo4AnalysisStep::GetEventSourceName(), TGo4Ratemeter::GetRate(), TGo4Ratemeter::GetTime(), TGo4Analysis::IsRunning(), TGo4AnalysisClientStatus::SetCurrentSource(), TGo4AnalysisClientStatus::SetRates(), TGo4AnalysisClientStatus::SetRunning(), TRACE, and TGo4Slave::UpdateStatus(). Referenced by CreateStatus(). |
|
suffix for main thread name
Definition at line 83 of file TGo4AnalysisClientImp.cxx. Referenced by Constructor(). |
|
suffix for watch thread name
Definition at line 82 of file TGo4AnalysisClientImp.cxx. Referenced by Constructor(). |
|
Number of mainloop runs between two updates of the client status object.
Definition at line 84 of file TGo4AnalysisClientImp.cxx. Referenced by TestBufferUpdateConditions(). |
|
Maximum time (in s) between two updates of the client status object.
Definition at line 85 of file TGo4AnalysisClientImp.cxx. Referenced by TestBufferUpdateConditions(). |
|
Timer period (in ms) for cint locking timer.
Definition at line 86 of file TGo4AnalysisClientImp.cxx. Referenced by SetCintMode(). |
|
The analysis the client is working on. Definition at line 182 of file TGo4AnalysisClientImp.h. Referenced by GetAnalysis(), Initialization(), SendAnalysisObject(), SendNamesList(), SetCintMode(), Start(), Stop(), TerminateFast(), TGo4AnalysisClient(), UpdateStatus(), and ~TGo4AnalysisClient(). |
|
remember name of main thread
Definition at line 185 of file TGo4AnalysisClientImp.h. Referenced by Constructor(), KillMain(), RestartMain(), Start(), StartWorkThreads(), StopWorkThreads(), TerminateFast(), and ~TGo4AnalysisClient(). |
|
remember name of watch thread
Definition at line 188 of file TGo4AnalysisClientImp.h. Referenced by Constructor(), StartWorkThreads(), StopWorkThreads(), TerminateFast(), and ~TGo4AnalysisClient(). |
|
absoulute time of the last status buffer update. Reset by TestBufferUpdateCondition Definition at line 191 of file TGo4AnalysisClientImp.h. Referenced by Start(), and TestBufferUpdateConditions(). |
|
Stopwatch controlling the buffer update time.
Definition at line 194 of file TGo4AnalysisClientImp.h. Referenced by Constructor(), Start(), TestBufferUpdateConditions(), and ~TGo4AnalysisClient(). |
|
Definition at line 198 of file TGo4AnalysisClientImp.h. Referenced by Constructor(), GetCurrentCount(), RestartMain(), Start(), TestRatemeter(), UpdateRate(), UpdateStatus(), and ~TGo4AnalysisClient(). |
|
Definition at line 203 of file TGo4AnalysisClientImp.h. Referenced by StartObjectServer(), and StopObjectServer(). |
|
If true, this slave will initialize and start analysis immediately without waiting for a submit/start command.
Definition at line 207 of file TGo4AnalysisClientImp.h. Referenced by Initialization(). |
|
If true, this slave runs to control CINT macro. Will have effect on some initialization behaviour. Definition at line 211 of file TGo4AnalysisClientImp.h. Referenced by IsCintMode(), and SetCintMode(). |
|
For cintmode, we only allow to release the main lock within a certain time window, triggered by this timer.
Definition at line 216 of file TGo4AnalysisClientImp.h. Referenced by SetCintMode(), and ~TGo4AnalysisClient(). |
|
use to treat Ctrl-C interrupts in CINT mode
Definition at line 219 of file TGo4AnalysisClientImp.h. Referenced by Constructor(), TGo4AnalysisClient(), and ~TGo4AnalysisClient(). |