GSI Object Oriented Online Offline (Go4) GO4-6.4.0
|
#include <TGo4AnalysisClientImp.h>
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 cintmode=kFALSE, Bool_t loadprefs=kTRUE, Bool_t showrate=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 () |
TGo4TaskStatus * | CreateStatus () override |
create a status object with information on the current client state. | |
void | ExecuteString (const char *command) override |
Execute string command. | |
TGo4Analysis * | GetAnalysis () const |
UInt_t | GetCurrentCount () const |
Number of currently processed events since last start. | |
Int_t | Initialization () override |
Override the ClientTask/ThreadManager Initialization used by AppControlTimer to init event classes before the threads are started. | |
Bool_t | IsCintMode () const |
void | KillMain () override |
Kill the main thread; method to be called from command, should be overridden in user implementation. | |
void | Quit () override |
Quit this instance and the owned task; method to be called from command object, may be overridden in user implementation. | |
void | RestartMain () override |
Restart the main thread; method to be called from command, should be overridden in user implementation. | |
void | SendAnalysisClientStatus () |
Send a complete status object of the analysis client via the status queue. | |
void | SendAnalysisObject (const char *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 | SendNamesList () |
Send the list of object names (folder structure) as status object to the gui. | |
void | SendStatusMessage (Int_t level, Bool_t printout, const TString &text) override |
Send message to gui. | |
void | SetCintMode (Bool_t on=kTRUE) |
void | Start () override |
General start method of slave application to be called from remote command; should be re-implemented by application. | |
void | StartObjectServer (const char *basename, const char *passwd) |
Start the object (histogram) server. | |
Int_t | StartWorkThreads () override |
start the working threads of the slave implementation; | |
void | Stop () override |
General stop method of slave application to be called from remote command; should be re-implemented by application. | |
void | StopObjectServer () |
Stop the object (histogram) server. | |
Int_t | StopWorkThreads () override |
stop the working threads of the slave implementation; | |
void | SubmitShutdown () |
void | Terminate (Bool_t termapp=kTRUE) override |
Overwrites the Threadmanager Terminate to shutdown the objectserver properly. | |
void | TerminateFast () override |
Overwrites the Threadmanager TerminateFast to shutdown the objectserver properly. | |
Bool_t | TestBufferUpdateConditions () |
Test if status buffer shall be updated now. | |
Bool_t | TestRatemeter () |
Test if ratemeter has been updated. | |
void | UpdateRate (Int_t counts=1) |
Update ratemeter. | |
![]() | |
TGo4Slave () | |
TGo4Slave (const char *name, Bool_t isserver=kTRUE, const char *serverhost="localhost", UInt_t negotport=5000) | |
virtual | ~TGo4Slave () |
TGo4ThreadHandler * | GetThreadHandler () |
Bool_t | MainIsRunning () const |
TGo4Command * | NextCommand () |
Delivers next command from command queue. | |
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. | |
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 |
![]() | |
TGo4CommandReceiver () | |
virtual | ~TGo4CommandReceiver () |
Static Public Attributes | |
static const char * | fgcMAINTHREAD = "MAIN-" |
suffix for main thread name | |
static const char * | fgcWATCHTHREAD = "WATCH-" |
suffix for watch thread name | |
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. | |
static const UInt_t | fguSTATUSUPDATE = 1000 |
Number of mainloop runs between two updates of the client status object. | |
Private Member Functions | |
TGo4AnalysisClient () | |
void | Constructor (Bool_t starthistserv=kFALSE, const char *basename="Go4", const char *passwd="abcd") |
void | UpdateStatus (TGo4TaskStatus *state) override |
Method needed by method CreateStatus of any status subclasses to set the values of the clienttask specific part of the status object. | |
Private Attributes | |
Bool_t | fbAutoStart {kFALSE} |
If true, this slave will initialize and start analysis immediately without waiting for a submit/start command. | |
Bool_t | fbCintMode {kFALSE} |
If true, this slave runs to control CINT macro. | |
Bool_t | fbLoadPrefs {kFALSE} |
If true, this slave load preferences for analysis from default file. | |
Bool_t | fbShowRate {kFALSE} |
Then enabled, show current rate on the analysis terminal window. | |
TString | fcMainName |
remember name of main thread | |
TString | fcWatchName |
remember name of watch thread | |
Double_t | fdBufferUpdateTime {0} |
absolute time of the last status buffer update. | |
TGo4Analysis * | fxAnalysis {nullptr} |
The analysis the client is working on. | |
TGo4HistogramServer * | fxHistoServer {nullptr} |
aggregation 1 histogram server (optional) | |
TGo4Ratemeter * | fxRatemeter {nullptr} |
aggregation 1 | |
Additional Inherited Members | |
![]() | |
void | SetTask (TGo4Task *task, Bool_t delold=kTRUE) |
Definition at line 34 of file TGo4AnalysisClientImp.h.
TGo4AnalysisClient::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 | cintmode = kFALSE, | ||
Bool_t | loadprefs = kTRUE, | ||
Bool_t | showrate = kFALSE ) |
Definition at line 49 of file TGo4AnalysisClientImp.cxx.
References TGo4Slave::TGo4Slave(), Constructor(), TGo4Log::Debug(), fbAutoStart, fbCintMode, fbLoadPrefs, fbShowRate, fdBufferUpdateTime, fxAnalysis, TGo4TaskOwner::GetName(), GO4TRACE, TGo4Analysis::Instance(), and SetCintMode().
Referenced by TGo4AnalysisClient().
TGo4AnalysisClient::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 ) |
Definition at line 83 of file TGo4AnalysisClientImp.cxx.
References TGo4Slave::TGo4Slave(), Constructor(), TGo4Log::Debug(), TGo4Log::Error(), fbAutoStart, fbCintMode, fbLoadPrefs, fbShowRate, fdBufferUpdateTime, fxAnalysis, TGo4TaskOwner::GetName(), GO4TRACE, and TGo4Analysis::Instance().
|
virtual |
Definition at line 155 of file TGo4AnalysisClientImp.cxx.
References TGo4ThreadHandler::CancelAll(), fxAnalysis, fxRatemeter, TGo4Slave::GetThreadHandler(), GO4TRACE, StopObjectServer(), and TGo4CommandInvoker::UnRegister().
|
private |
References TGo4AnalysisClient().
|
private |
Definition at line 118 of file TGo4AnalysisClientImp.cxx.
References TGo4Log::Debug(), fcMainName, fcWatchName, fgcMAINTHREAD, fgcWATCHTHREAD, fxAnalysis, fxRatemeter, TGo4TaskOwner::GetName(), TGo4TaskOwner::GetTask(), TGo4Slave::GetThreadHandler(), TGo4CommandInvoker::Instance(), TGo4TaskOwner::IsServer(), TGo4ThreadManager::Launch(), TGo4ThreadHandler::NewThread(), TGo4CommandInvoker::Register(), TGo4TaskHandler::SetAdminAccount(), TGo4CommandInvoker::SetCommandList(), TGo4TaskHandler::SetCtrlAccount(), TGo4TaskHandler::SetObservAccount(), StartObjectServer(), TGo4Slave::Stop(), and TGo4Slave::UpdateStatusBuffer().
Referenced by TGo4AnalysisClient(), and TGo4AnalysisClient().
|
overridevirtual |
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 258 of file TGo4AnalysisClientImp.cxx.
References TGo4TaskOwner::GetName(), GO4TRACE, and UpdateStatus().
|
overridevirtual |
Execute string command.
Overrides base class implementation to decouple some commands from analysis client.
Reimplemented from TGo4Slave.
Definition at line 494 of file TGo4AnalysisClientImp.cxx.
References fxAnalysis, StartObjectServer(), and StopObjectServer().
|
inline |
Definition at line 60 of file TGo4AnalysisClientImp.h.
References fxAnalysis.
Referenced by TGo4AnalysisMainRunnable::TGo4AnalysisMainRunnable(), TGo4AnalysisWatchRunnable::TGo4AnalysisWatchRunnable(), and SendAnalysisStatus().
UInt_t TGo4AnalysisClient::GetCurrentCount | ( | ) | const |
Number of currently processed events since last start.
Definition at line 411 of file TGo4AnalysisClientImp.cxx.
References fxRatemeter.
Referenced by TestBufferUpdateConditions().
|
overridevirtual |
Override the ClientTask/ThreadManager Initialization used by AppControlTimer to init event classes before the threads are started.
Reimplemented from TGo4Slave.
Definition at line 177 of file TGo4AnalysisClientImp.cxx.
References fbAutoStart, fbLoadPrefs, TGo4Analysis::fgcDEFAULTSTATUSFILENAME, fxAnalysis, TGo4TaskOwner::GetName(), IsCintMode(), SendAnalysisStatus(), SendStatusMessage(), Start(), TGo4Slave::Stop(), TGo4LockGuard, and TGo4Slave::UpdateStatusBuffer().
|
inline |
Definition at line 151 of file TGo4AnalysisClientImp.h.
References fbCintMode.
Referenced by Initialization().
|
overridevirtual |
Kill the main thread; method to be called from command, should be overridden in user implementation.
Reimplemented from TGo4Slave.
Definition at line 342 of file TGo4AnalysisClientImp.cxx.
References TGo4ThreadHandler::Cancel(), fcMainName, TGo4TaskOwner::GetName(), TGo4TaskOwner::GetTask(), TGo4Slave::GetThreadHandler(), GO4TRACE, SendStatusMessage(), TGo4ThreadHandler::Stop(), and TGo4Task::WakeCommandQueue().
|
overridevirtual |
Quit this instance and the owned task; method to be called from command object, may be overridden in user implementation.
Reimplemented from TGo4TaskOwner.
Definition at line 455 of file TGo4AnalysisClientImp.cxx.
References fxAnalysis, and Stop().
Referenced by TGo4Sniffer::CmdExit().
|
overridevirtual |
Restart the main thread; method to be called from command, should be overridden in user implementation.
Reimplemented from TGo4Slave.
Definition at line 352 of file TGo4AnalysisClientImp.cxx.
References fcMainName, fxRatemeter, TGo4TaskOwner::GetName(), TGo4TaskOwner::GetTask(), TGo4Slave::GetThreadHandler(), GO4TRACE, TGo4ThreadHandler::ReCreate(), SendStatusMessage(), TGo4ThreadHandler::Start(), TGo4ThreadHandler::Stop(), and TGo4Task::WakeCommandQueue().
void TGo4AnalysisClient::SendAnalysisClientStatus | ( | ) |
Send a complete status object of the analysis client via the status queue.
Definition at line 311 of file TGo4AnalysisClientImp.cxx.
References TGo4Log::Debug(), GO4TRACE, and TGo4Slave::SendStatusBuffer().
void TGo4AnalysisClient::SendAnalysisObject | ( | const char * | name | ) |
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 289 of file TGo4AnalysisClientImp.cxx.
References fxAnalysis, GO4TRACE, and TGo4Slave::SendObject().
void TGo4AnalysisClient::SendAnalysisStatus | ( | ) |
Send a complete status object of the analysis via the status queue.
Definition at line 296 of file TGo4AnalysisClientImp.cxx.
References TGo4Analysis::CreateStatus(), TGo4Log::Debug(), GetAnalysis(), GO4TRACE, TGo4Slave::SendStatus(), and SendStatusMessage().
Referenced by Initialization().
void TGo4AnalysisClient::SendNamesList | ( | ) |
Send the list of object names (folder structure) as status object to the gui.
Definition at line 324 of file TGo4AnalysisClientImp.cxx.
References TGo4Log::Debug(), fxAnalysis, GO4TRACE, TGo4Slave::SendObject(), and SendStatusMessage().
|
overridevirtual |
Send message to gui.
Reimplemented from TGo4Slave.
Definition at line 540 of file TGo4AnalysisClientImp.cxx.
References fxAnalysis, and TGo4Slave::SendStatusMessage().
Referenced by TGo4ComAddTreeHistogram::ExeCom(), TGo4ComAutosave::ExeCom(), TGo4ComClearObject::ExeCom(), TGo4ComCloseAnalysis::ExeCom(), TGo4ComDeleteObject::ExeCom(), TGo4ComGetAnalysisStatus::ExeCom(), TGo4ComGetCurrentEvent::ExeCom(), TGo4ComGetNamesList::ExeCom(), TGo4ComGetObjectStatus::ExeCom(), TGo4ComInitAnalysis::ExeCom(), TGo4ComLoadAnalysisStatus::ExeCom(), TGo4ComPrintConditions::ExeCom(), TGo4ComPrintDynList::ExeCom(), TGo4ComPrintHistograms::ExeCom(), TGo4ComSaveAnalysisStatus::ExeCom(), TGo4ComSetAnalysisStatus::ExeCom(), TGo4ComSetPrintEvent::ExeCom(), TGo4ComSetProtections::ExeCom(), Initialization(), KillMain(), TGo4AnalysisCommand::RefuseCom(), RestartMain(), SendAnalysisStatus(), SendNamesList(), Start(), and Stop().
void TGo4AnalysisClient::SetCintMode | ( | Bool_t | on = kTRUE | ) |
Definition at line 530 of file TGo4AnalysisClientImp.cxx.
References fbCintMode, and fxAnalysis.
Referenced by TGo4AnalysisClient(), and Terminate().
|
overridevirtual |
General start method of slave application to be called from remote command; should be re-implemented by application.
Reimplemented from TGo4Slave.
Definition at line 267 of file TGo4AnalysisClientImp.cxx.
References fcMainName, fdBufferUpdateTime, fxAnalysis, fxRatemeter, TGo4TaskOwner::GetName(), TGo4Slave::GetThreadHandler(), GO4TRACE, TGo4Slave::MainIsRunning(), SendStatusMessage(), TGo4Slave::Start(), TGo4ThreadHandler::Start(), UpdateRate(), and TGo4Slave::UpdateStatusBuffer().
Referenced by TGo4Sniffer::CmdRestart(), and Initialization().
void TGo4AnalysisClient::StartObjectServer | ( | const char * | basename, |
const char * | passwd ) |
Start the object (histogram) server.
Existing server will be stopped and replaced by new server with different basename and password.
Definition at line 437 of file TGo4AnalysisClientImp.cxx.
References fxHistoServer, and StopObjectServer().
Referenced by Constructor(), and ExecuteString().
|
overridevirtual |
start the working threads of the slave implementation;
Reimplemented from TGo4TaskOwner.
Definition at line 510 of file TGo4AnalysisClientImp.cxx.
References fcMainName, fcWatchName, TGo4Slave::GetThreadHandler(), TGo4ThreadHandler::Start(), and TGo4TaskOwner::StartWorkThreads().
|
overridevirtual |
General stop method of slave application to be called from remote command; should be re-implemented by application.
Reimplemented from TGo4Slave.
Definition at line 366 of file TGo4AnalysisClientImp.cxx.
References fxAnalysis, TGo4TaskOwner::GetName(), TGo4TaskOwner::GetTask(), GO4TRACE, TGo4Slave::MainIsRunning(), SendStatusMessage(), TGo4Slave::Stop(), UpdateRate(), and TGo4Slave::UpdateStatusBuffer().
Referenced by TGo4Sniffer::CmdClose(), TGo4Sniffer::CmdExit(), TGo4Sniffer::CmdRestart(), and Quit().
void TGo4AnalysisClient::StopObjectServer | ( | ) |
Stop the object (histogram) server.
Definition at line 446 of file TGo4AnalysisClientImp.cxx.
References fxHistoServer.
Referenced by ~TGo4AnalysisClient(), ExecuteString(), StartObjectServer(), Terminate(), and TerminateFast().
|
overridevirtual |
stop the working threads of the slave implementation;
Reimplemented from TGo4TaskOwner.
Definition at line 520 of file TGo4AnalysisClientImp.cxx.
References fcMainName, fcWatchName, TGo4Slave::GetThreadHandler(), TGo4ThreadHandler::Stop(), and TGo4TaskOwner::StopWorkThreads().
void TGo4AnalysisClient::SubmitShutdown | ( | ) |
Definition at line 485 of file TGo4AnalysisClientImp.cxx.
References TGo4TaskOwner::GetTask(), and TGo4Task::SubmitLocalCommand().
|
overridevirtual |
Overwrites the Threadmanager Terminate to shutdown the objectserver properly.
Reimplemented from TGo4Slave.
Definition at line 461 of file TGo4AnalysisClientImp.cxx.
References TGo4TaskOwner::GetTask(), SetCintMode(), and StopObjectServer().
|
overridevirtual |
Overwrites the Threadmanager TerminateFast to shutdown the objectserver properly.
Reimplemented from TGo4Slave.
Definition at line 469 of file TGo4AnalysisClientImp.cxx.
References TGo4ThreadHandler::Cancel(), TGo4Log::Debug(), fcMainName, fcWatchName, fxAnalysis, TGo4TaskOwner::GetTask(), TGo4Slave::GetThreadHandler(), TGo4ThreadHandler::StopAll(), and StopObjectServer().
Bool_t TGo4AnalysisClient::TestBufferUpdateConditions | ( | ) |
Test if status buffer shall be updated now.
Definition at line 421 of file TGo4AnalysisClientImp.cxx.
References fdBufferUpdateTime, fgdSTATUSTIMEOUT, fguSTATUSUPDATE, and GetCurrentCount().
Bool_t TGo4AnalysisClient::TestRatemeter | ( | ) |
Test if ratemeter has been updated.
Definition at line 416 of file TGo4AnalysisClientImp.cxx.
References fxRatemeter.
void TGo4AnalysisClient::UpdateRate | ( | Int_t | counts = 1 | ) |
Update ratemeter.
To be used from main thread.
Definition at line 392 of file TGo4AnalysisClientImp.cxx.
References fbShowRate, fxAnalysis, fxRatemeter, GO4TRACE, TGo4Analysis::Instance(), TGo4Analysis::IsRunning(), and TGo4Log::PrintRate().
|
overrideprivatevirtual |
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 237 of file TGo4AnalysisClientImp.cxx.
References fxAnalysis, fxRatemeter, TGo4AnalysisStep::GetEventSourceName(), GO4TRACE, TGo4AnalysisClientStatus::SetCurrentSource(), TGo4AnalysisClientStatus::SetRates(), TGo4AnalysisClientStatus::SetRunning(), and TGo4Slave::UpdateStatus().
Referenced by CreateStatus().
|
private |
If true, this slave will initialize and start analysis immediately without waiting for a submit/start command.
Definition at line 204 of file TGo4AnalysisClientImp.h.
Referenced by TGo4AnalysisClient(), TGo4AnalysisClient(), and Initialization().
|
private |
If true, this slave runs to control CINT macro.
Will have effect on some initialization behavior.
Definition at line 208 of file TGo4AnalysisClientImp.h.
Referenced by TGo4AnalysisClient(), TGo4AnalysisClient(), IsCintMode(), and SetCintMode().
|
private |
If true, this slave load preferences for analysis from default file.
Definition at line 211 of file TGo4AnalysisClientImp.h.
Referenced by TGo4AnalysisClient(), TGo4AnalysisClient(), and Initialization().
|
private |
Then enabled, show current rate on the analysis terminal window.
Definition at line 214 of file TGo4AnalysisClientImp.h.
Referenced by TGo4AnalysisClient(), TGo4AnalysisClient(), and UpdateRate().
|
private |
remember name of main thread
Definition at line 185 of file TGo4AnalysisClientImp.h.
Referenced by Constructor(), KillMain(), RestartMain(), Start(), StartWorkThreads(), StopWorkThreads(), and TerminateFast().
|
private |
remember name of watch thread
Definition at line 188 of file TGo4AnalysisClientImp.h.
Referenced by Constructor(), StartWorkThreads(), StopWorkThreads(), and TerminateFast().
|
private |
absolute time of the last status buffer update.
Reset by TestBufferUpdateCondition
Definition at line 191 of file TGo4AnalysisClientImp.h.
Referenced by TGo4AnalysisClient(), TGo4AnalysisClient(), Start(), and TestBufferUpdateConditions().
|
static |
suffix for main thread name
Definition at line 154 of file TGo4AnalysisClientImp.h.
Referenced by Constructor().
|
static |
suffix for watch thread name
Definition at line 157 of file TGo4AnalysisClientImp.h.
Referenced by Constructor().
|
static |
Maximum time (in s) between two updates of the client status object.
Definition at line 163 of file TGo4AnalysisClientImp.h.
Referenced by TestBufferUpdateConditions().
|
static |
Timer period (in ms) for cint locking timer.
Definition at line 166 of file TGo4AnalysisClientImp.h.
|
static |
Number of mainloop runs between two updates of the client status object.
Definition at line 160 of file TGo4AnalysisClientImp.h.
Referenced by TestBufferUpdateConditions().
|
private |
The analysis the client is working on.
aggregationByValue 1 0..1
Definition at line 182 of file TGo4AnalysisClientImp.h.
Referenced by TGo4AnalysisClient(), TGo4AnalysisClient(), ~TGo4AnalysisClient(), Constructor(), ExecuteString(), GetAnalysis(), Initialization(), Quit(), SendAnalysisObject(), SendNamesList(), SendStatusMessage(), SetCintMode(), Start(), Stop(), TerminateFast(), UpdateRate(), and UpdateStatus().
|
private |
aggregation 1 histogram server (optional)
Definition at line 200 of file TGo4AnalysisClientImp.h.
Referenced by StartObjectServer(), and StopObjectServer().
|
private |
aggregation 1
Definition at line 195 of file TGo4AnalysisClientImp.h.
Referenced by ~TGo4AnalysisClient(), Constructor(), GetCurrentCount(), RestartMain(), Start(), TestRatemeter(), UpdateRate(), and UpdateStatus().