GSI Object Oriented Online Offline (Go4)
GO4-6.1.2
|
#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 () |
TGo4Analysis * | GetAnalysis () const |
virtual void | Start () |
virtual void | Stop () |
virtual void | Quit () |
virtual void | KillMain () |
virtual void | RestartMain () |
virtual TGo4TaskStatus * | CreateStatus () |
virtual Int_t | Initialization () |
void | SendAnalysisObject (const char *name) |
void | SendAnalysisStatus () |
void | SendAnalysisClientStatus () |
void | SendNamesList () |
void | UpdateRate (Int_t counts=1) |
UInt_t | GetCurrentCount () |
Bool_t | TestRatemeter () |
Bool_t | TestBufferUpdateConditions () |
void | StartObjectServer (const char *basename, const char *passwd) |
void | StopObjectServer () |
virtual Int_t | StartWorkThreads () |
virtual Int_t | StopWorkThreads () |
virtual void | Terminate (Bool_t termapp=kTRUE) |
virtual void | TerminateFast () |
void | SubmitShutdown () |
virtual void | SendStatusMessage (Int_t level, Bool_t printout, const TString &text) |
virtual void | ExecuteString (const char *command) |
void | SetCintMode (Bool_t on=kTRUE) |
Bool_t | IsCintMode () const |
![]() | |
TGo4Slave () | |
TGo4Slave (const char *name, Bool_t isserver=kTRUE, const char *serverhost="localhost", UInt_t negotport=5000) | |
virtual | ~TGo4Slave () |
Bool_t | MainIsRunning () |
TGo4Command * | NextCommand () |
void | SendObject (TObject *obj, const char *receiver=0) |
void | SendStatus (TGo4Status *stat, const char *receiver=0) |
TGo4ThreadHandler * | GetThreadHandler () |
void | SendStatusBuffer () |
void | UpdateStatusBuffer () |
![]() | |
TGo4TaskOwner () | |
TGo4TaskOwner (Bool_t isserver) | |
virtual | ~TGo4TaskOwner () |
Bool_t | IsServer () |
TGo4Task * | GetTask () |
const char * | GetName () const |
Bool_t | IsConnected () |
Bool_t | IsBeingQuit () |
TMutex * | GetTaskManagerMutex () |
![]() | |
TGo4CommandReceiver () | |
virtual | ~TGo4CommandReceiver () |
Static Public Attributes | |
static const char * | fgcMAINTHREAD ="MAIN-" |
static const char * | fgcWATCHTHREAD ="WATCH-" |
static const UInt_t | fguSTATUSUPDATE = 1000 |
static const Double_t | fgdSTATUSTIMEOUT = 2 |
static const UInt_t | fguCINTTIMERPERIOD = 200 |
Private Member Functions | |
void | Constructor (Bool_t starthistserv=kFALSE, const char *basename="Go4", const char *passwd="abcd") |
void | UpdateStatus (TGo4TaskStatus *state) |
TGo4AnalysisClient () | |
Private Attributes | |
TGo4Analysis * | fxAnalysis |
TString | fcMainName |
TString | fcWatchName |
Double_t | fdBufferUpdateTime |
TGo4Ratemeter * | fxRatemeter |
TGo4HistogramServer * | fxHistoServer |
Bool_t | fbAutoStart |
Bool_t | fbCintMode |
Bool_t | fbLoadPrefs |
Bool_t | fbShowRate |
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 Constructor(), TGo4Log::Debug(), fxAnalysis, TGo4TaskOwner::GetName(), GO4TRACE, TGo4Analysis::Instance(), TGo4Analysis::SetAnalysisClient(), and SetCintMode().
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 84 of file TGo4AnalysisClientImp.cxx.
References Constructor(), TGo4Log::Debug(), TGo4Log::Error(), fxAnalysis, TGo4TaskOwner::GetName(), GO4TRACE, TGo4Analysis::Instance(), and TGo4Analysis::SetAnalysisClient().
|
virtual |
Definition at line 162 of file TGo4AnalysisClientImp.cxx.
References TGo4ThreadHandler::CancelAll(), fxAnalysis, fxRatemeter, TGo4Slave::GetThreadHandler(), GO4TRACE, TGo4Analysis::LockAutoSave(), StopObjectServer(), TGo4Analysis::UnLockAutoSave(), and TGo4CommandInvoker::UnRegister().
|
private |
|
private |
Definition at line 125 of file TGo4AnalysisClientImp.cxx.
References TGo4Log::Debug(), fcMainName, fcWatchName, fgcMAINTHREAD, fgcWATCHTHREAD, TGo4Analysis::fServerAdminPass, TGo4Analysis::fServerCtrlPass, TGo4Analysis::fServerObserverPass, 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().
|
virtual |
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 265 of file TGo4AnalysisClientImp.cxx.
References TGo4TaskOwner::GetName(), GO4TRACE, and UpdateStatus().
|
virtual |
Execute string command. Overrides base class implementation to decouple some commands from analysis client.
Reimplemented from TGo4Slave.
Definition at line 521 of file TGo4AnalysisClientImp.cxx.
References TGo4Analysis::ExecuteLine(), fxAnalysis, StartObjectServer(), and StopObjectServer().
|
inline |
Definition at line 60 of file TGo4AnalysisClientImp.h.
References fxAnalysis.
Referenced by SendAnalysisStatus(), TGo4AnalysisMainRunnable::TGo4AnalysisMainRunnable(), TGo4AnalysisWatchRunnable::TGo4AnalysisWatchRunnable(), and TGo4HistogramServer::TGo4HistogramServer().
UInt_t TGo4AnalysisClient::GetCurrentCount | ( | ) |
Number of currently processed events since last start.
Definition at line 429 of file TGo4AnalysisClientImp.cxx.
References fxRatemeter, and TGo4Ratemeter::GetCurrentCount().
Referenced by TestBufferUpdateConditions().
|
virtual |
Override the ClientTask/ThreadManager Initialization used by AppControlTimer to init event classes before the threads are started.
Reimplemented from TGo4Slave.
Definition at line 182 of file TGo4AnalysisClientImp.cxx.
References fbAutoStart, fbLoadPrefs, TGo4Analysis::fgcDEFAULTSTATUSFILENAME, fxAnalysis, TGo4TaskOwner::GetName(), TGo4Analysis::InitEventClasses(), TGo4Analysis::IsAutoSaveOn(), IsCintMode(), TGo4Analysis::LoadObjects(), TGo4Analysis::LoadStatus(), SendAnalysisStatus(), SendStatusMessage(), Start(), TGo4Slave::Stop(), and TGo4Slave::UpdateStatusBuffer().
|
inline |
Definition at line 151 of file TGo4AnalysisClientImp.h.
References fbCintMode.
Referenced by Initialization(), and TGo4AnalysisMainRunnable::Run().
|
virtual |
Kill the main thread; method to be called from command, should be overridden in user implementation
Reimplemented from TGo4Slave.
Definition at line 349 of file TGo4AnalysisClientImp.cxx.
References TGo4ThreadHandler::Cancel(), fcMainName, TGo4TaskOwner::GetName(), TGo4TaskOwner::GetTask(), TGo4Slave::GetThreadHandler(), GO4TRACE, SendStatusMessage(), TGo4ThreadHandler::Stop(), and TGo4Task::WakeCommandQueue().
|
virtual |
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 476 of file TGo4AnalysisClientImp.cxx.
References TGo4Analysis::CloseAnalysis(), fxAnalysis, and Stop().
Referenced by TGo4Sniffer::CmdExit().
|
virtual |
Restart the main thread; method to be called from command, should be overridden in user implementation
Reimplemented from TGo4Slave.
Definition at line 359 of file TGo4AnalysisClientImp.cxx.
References fcMainName, fxRatemeter, TGo4TaskOwner::GetName(), TGo4TaskOwner::GetTask(), TGo4Slave::GetThreadHandler(), GO4TRACE, TGo4ThreadHandler::ReCreate(), TGo4Ratemeter::Reset(), 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 318 of file TGo4AnalysisClientImp.cxx.
References TGo4Log::Debug(), GO4TRACE, and TGo4Slave::SendStatusBuffer().
Referenced by TGo4AnalysisWatchRunnable::Run().
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 296 of file TGo4AnalysisClientImp.cxx.
References fxAnalysis, TGo4Analysis::GetObject(), GO4TRACE, and TGo4Slave::SendObject().
void TGo4AnalysisClient::SendAnalysisStatus | ( | ) |
Send a complete status object of the analysis via the status queue.
Definition at line 303 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 331 of file TGo4AnalysisClientImp.cxx.
References TGo4Log::Debug(), fxAnalysis, TGo4Analysis::GetNamesList(), GO4TRACE, TGo4Slave::SendObject(), SendStatusMessage(), and TGo4Analysis::UpdateNamesList().
|
virtual |
Send message to gui
Reimplemented from TGo4Slave.
Definition at line 573 of file TGo4AnalysisClientImp.cxx.
References fxAnalysis, TGo4Analysis::GetSniffer(), TGo4Slave::SendStatusMessage(), and TGo4AnalysisSniffer::StatusMessage().
Referenced by TGo4ComCloseAnalysis::ExeCom(), TGo4ComInitAnalysis::ExeCom(), TGo4ComPrintConditions::ExeCom(), TGo4ComPrintDynList::ExeCom(), TGo4ComAutosave::ExeCom(), TGo4ComPrintHistograms::ExeCom(), TGo4ComGetNamesList::ExeCom(), TGo4ComGetAnalysisStatus::ExeCom(), TGo4ComLoadAnalysisStatus::ExeCom(), TGo4ComSaveAnalysisStatus::ExeCom(), TGo4ComGetObjectStatus::ExeCom(), TGo4ComSetProtections::ExeCom(), TGo4ComDeleteObject::ExeCom(), TGo4ComSetAnalysisStatus::ExeCom(), TGo4ComClearObject::ExeCom(), TGo4ComSetPrintEvent::ExeCom(), TGo4ComGetCurrentEvent::ExeCom(), TGo4ComAddTreeHistogram::ExeCom(), TGo4ComSetObject::ExeCom(), TGo4ComSetObject::ExeSetCon(), TGo4ComSetObject::ExeSetDyn(), TGo4ComSetObject::ExeSetHis(), TGo4ComSetObject::ExeSetObj(), TGo4ComSetObject::ExeSetPar(), TGo4ComSetObject::ExeSetParStatus(), TGo4ComSetObject::ExeSetPic(), Initialization(), KillMain(), TGo4AnalysisCommand::RefuseCom(), RestartMain(), TGo4AnalysisMainRunnable::Run(), SendAnalysisStatus(), TGo4Analysis::SendMessageToGUI(), SendNamesList(), Start(), and Stop().
void TGo4AnalysisClient::SetCintMode | ( | Bool_t | on = kTRUE | ) |
Definition at line 563 of file TGo4AnalysisClientImp.cxx.
References fbCintMode, fxAnalysis, and TGo4Analysis::SetAutoSave().
Referenced by main(), Terminate(), and TGo4AnalysisClient().
|
virtual |
General start method of slave application to be called from remote command; should be re-implemented by application
Reimplemented from TGo4Slave.
Definition at line 274 of file TGo4AnalysisClientImp.cxx.
References fcMainName, fdBufferUpdateTime, fxAnalysis, fxRatemeter, TGo4TaskOwner::GetName(), TGo4Analysis::GetName(), TGo4Slave::GetThreadHandler(), GO4TRACE, TGo4Analysis::IsInitDone(), TGo4Slave::MainIsRunning(), TGo4Analysis::PreLoop(), TGo4Ratemeter::Reset(), SendStatusMessage(), TGo4Slave::Start(), TGo4ThreadHandler::Start(), UpdateRate(), and TGo4Slave::UpdateStatusBuffer().
Referenced by TGo4Sniffer::CmdRestart(), Initialization(), TGo4Analysis::SetRunning(), and TGo4Analysis::StartAnalysis().
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 455 of file TGo4AnalysisClientImp.cxx.
References fxHistoServer, and StopObjectServer().
Referenced by Constructor(), and ExecuteString().
|
virtual |
start the working threads of the slave implementation;
Reimplemented from TGo4TaskOwner.
Definition at line 541 of file TGo4AnalysisClientImp.cxx.
References fcMainName, fcWatchName, TGo4Slave::GetThreadHandler(), TGo4ThreadHandler::Start(), and TGo4TaskOwner::StartWorkThreads().
|
virtual |
General stop method of slave application to be called from remote command; should be re-implemented by application
Reimplemented from TGo4Slave.
Definition at line 373 of file TGo4AnalysisClientImp.cxx.
References fxAnalysis, TGo4TaskOwner::GetName(), TGo4TaskOwner::GetTask(), GO4TRACE, TGo4Slave::MainIsRunning(), TGo4Analysis::PostLoop(), SendStatusMessage(), TGo4Slave::Stop(), UpdateRate(), and TGo4Slave::UpdateStatusBuffer().
Referenced by TGo4Sniffer::CmdClose(), TGo4Sniffer::CmdExit(), TGo4Sniffer::CmdRestart(), TGo4Analysis::Process(), Quit(), TGo4AnalysisMainRunnable::Run(), TGo4Analysis::SetRunning(), and TGo4Analysis::StopAnalysis().
void TGo4AnalysisClient::StopObjectServer | ( | ) |
Stop the object (histogram) server.
Definition at line 465 of file TGo4AnalysisClientImp.cxx.
References fxHistoServer.
Referenced by ExecuteString(), StartObjectServer(), Terminate(), TerminateFast(), and ~TGo4AnalysisClient().
|
virtual |
stop the working threads of the slave implementation;
Reimplemented from TGo4TaskOwner.
Definition at line 552 of file TGo4AnalysisClientImp.cxx.
References fcMainName, fcWatchName, TGo4Slave::GetThreadHandler(), TGo4ThreadHandler::Stop(), and TGo4TaskOwner::StopWorkThreads().
void TGo4AnalysisClient::SubmitShutdown | ( | ) |
Definition at line 509 of file TGo4AnalysisClientImp.cxx.
References TGo4TaskOwner::GetTask(), and TGo4Task::SubmitLocalCommand().
Referenced by TGo4Analysis::ShutdownServer().
|
virtual |
Overwrites the Threadmanager Terminate to shutdown the objectserver properly
Reimplemented from TGo4Slave.
Definition at line 485 of file TGo4AnalysisClientImp.cxx.
References TGo4TaskOwner::GetTask(), SetCintMode(), and StopObjectServer().
|
virtual |
Overwrites the Threadmanager TerminateFast to shutdown the objectserver properly
Reimplemented from TGo4Slave.
Definition at line 493 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 439 of file TGo4AnalysisClientImp.cxx.
References fdBufferUpdateTime, fgdSTATUSTIMEOUT, fguSTATUSUPDATE, and GetCurrentCount().
Referenced by TGo4Analysis::MainCycle().
Bool_t TGo4AnalysisClient::TestRatemeter | ( | ) |
Test if ratemeter has been updated.
Definition at line 434 of file TGo4AnalysisClientImp.cxx.
References fxRatemeter, and TGo4Ratemeter::TestUpdate().
Referenced by TGo4AnalysisWatchRunnable::Run().
void TGo4AnalysisClient::UpdateRate | ( | Int_t | counts = 1 | ) |
Update ratemeter. To be used from main thread.
Definition at line 403 of file TGo4AnalysisClientImp.cxx.
References fbShowRate, fxAnalysis, fxRatemeter, TGo4Ratemeter::GetCurrentCount(), TGo4Log::GetPrintfArg(), TGo4Ratemeter::GetRate(), TGo4Analysis::GetSniffer(), GO4TRACE, TGo4Analysis::Instance(), TGo4Analysis::IsRunning(), TGo4AnalysisSniffer::RatemeterUpdate(), TGo4Ratemeter::SetDateTime(), TGo4Ratemeter::SetRunning(), and TGo4Ratemeter::Update().
Referenced by TGo4Analysis::MainCycle(), TGo4AnalysisWatchRunnable::Run(), Start(), and Stop().
|
privatevirtual |
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 243 of file TGo4AnalysisClientImp.cxx.
References fxAnalysis, fxRatemeter, TGo4Analysis::GetAnalysisStep(), TGo4Ratemeter::GetAvRate(), TGo4Ratemeter::GetCurrentCount(), TGo4AnalysisStep::GetEventSourceName(), TGo4Ratemeter::GetRate(), TGo4Ratemeter::GetTime(), GO4TRACE, TGo4Analysis::IsRunning(), TGo4AnalysisClientStatus::SetCurrentSource(), TGo4Ratemeter::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 206 of file TGo4AnalysisClientImp.h.
Referenced by Initialization().
|
private |
If true, this slave runs to control CINT macro. Will have effect on some initialization behaviour.
Definition at line 210 of file TGo4AnalysisClientImp.h.
Referenced by IsCintMode(), and SetCintMode().
|
private |
If true, this slave load preferences for analysis from default file.
Definition at line 213 of file TGo4AnalysisClientImp.h.
Referenced by Initialization().
|
private |
Then enabled, show current rate on the analysis terminal window
Definition at line 216 of file TGo4AnalysisClientImp.h.
Referenced by UpdateRate().
|
private |
remember name of main thread
Definition at line 187 of file TGo4AnalysisClientImp.h.
Referenced by Constructor(), KillMain(), RestartMain(), Start(), StartWorkThreads(), StopWorkThreads(), and TerminateFast().
|
private |
remember name of watch thread
Definition at line 190 of file TGo4AnalysisClientImp.h.
Referenced by Constructor(), StartWorkThreads(), StopWorkThreads(), and TerminateFast().
|
private |
absoulute time of the last status buffer update. Reset by TestBufferUpdateCondition
Definition at line 193 of file TGo4AnalysisClientImp.h.
Referenced by 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. 1 0..1
Definition at line 184 of file TGo4AnalysisClientImp.h.
Referenced by Constructor(), ExecuteString(), GetAnalysis(), Initialization(), Quit(), SendAnalysisObject(), SendNamesList(), SendStatusMessage(), SetCintMode(), Start(), Stop(), TerminateFast(), TGo4AnalysisClient(), UpdateRate(), UpdateStatus(), and ~TGo4AnalysisClient().
|
private |
Definition at line 202 of file TGo4AnalysisClientImp.h.
Referenced by StartObjectServer(), and StopObjectServer().
|
private |
Definition at line 197 of file TGo4AnalysisClientImp.h.
Referenced by Constructor(), GetCurrentCount(), RestartMain(), Start(), TestRatemeter(), UpdateRate(), UpdateStatus(), and ~TGo4AnalysisClient().