GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4AnalysisClient Class Reference

#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 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 ()
 
TGo4TaskStatusCreateStatus () override
 create a status object with information on the current client state.
 
void ExecuteString (const char *command) override
 Execute string command.
 
TGo4AnalysisGetAnalysis () 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.
 
- Public Member Functions inherited from TGo4Slave
 TGo4Slave ()
 
 TGo4Slave (const char *name, Bool_t isserver=kTRUE, const char *serverhost="localhost", UInt_t negotport=5000)
 
virtual ~TGo4Slave ()
 
TGo4ThreadHandlerGetThreadHandler ()
 
Bool_t MainIsRunning () const
 
TGo4CommandNextCommand ()
 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.
 
- Public Member Functions inherited from TGo4TaskOwner
 TGo4TaskOwner ()
 
 TGo4TaskOwner (Bool_t isserver)
 
virtual ~TGo4TaskOwner ()
 
const char * GetName () const
 
TGo4TaskGetTask () const
 
TMutex * GetTaskManagerMutex ()
 Access to taskmanager mutex; to be locked outside main mutex.
 
Bool_t IsBeingQuit ()
 
Bool_t IsConnected ()
 
Bool_t IsServer () const
 
- Public Member Functions inherited from TGo4CommandReceiver
 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.
 
TGo4AnalysisfxAnalysis {nullptr}
 The analysis the client is working on.
 
TGo4HistogramServerfxHistoServer {nullptr}
 aggregation 1 histogram server (optional)
 
TGo4RatemeterfxRatemeter {nullptr}
 aggregation 1
 

Additional Inherited Members

- Protected Member Functions inherited from TGo4TaskOwner
void SetTask (TGo4Task *task, Bool_t delold=kTRUE)
 

Detailed Description

Author
J. Adamczewski
Since
12/2000, last 5/2005

Definition at line 34 of file TGo4AnalysisClientImp.h.

Constructor & Destructor Documentation

◆ TGo4AnalysisClient() [1/3]

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 )

◆ TGo4AnalysisClient() [2/3]

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 )

◆ ~TGo4AnalysisClient()

TGo4AnalysisClient::~TGo4AnalysisClient ( )
virtual

◆ TGo4AnalysisClient() [3/3]

TGo4AnalysisClient::TGo4AnalysisClient ( )
private

References TGo4AnalysisClient().

Member Function Documentation

◆ Constructor()

◆ CreateStatus()

TGo4TaskStatus * TGo4AnalysisClient::CreateStatus ( )
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().

◆ ExecuteString()

void TGo4AnalysisClient::ExecuteString ( const char * command)
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().

◆ GetAnalysis()

TGo4Analysis * TGo4AnalysisClient::GetAnalysis ( ) const
inline

◆ GetCurrentCount()

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().

◆ Initialization()

Int_t TGo4AnalysisClient::Initialization ( )
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().

◆ IsCintMode()

Bool_t TGo4AnalysisClient::IsCintMode ( ) const
inline

Definition at line 151 of file TGo4AnalysisClientImp.h.

References fbCintMode.

Referenced by Initialization().

◆ KillMain()

void TGo4AnalysisClient::KillMain ( )
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().

◆ Quit()

void TGo4AnalysisClient::Quit ( )
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().

◆ RestartMain()

void TGo4AnalysisClient::RestartMain ( )
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().

◆ SendAnalysisClientStatus()

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().

◆ SendAnalysisObject()

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().

◆ SendAnalysisStatus()

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().

◆ SendNamesList()

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().

◆ SendStatusMessage()

◆ SetCintMode()

void TGo4AnalysisClient::SetCintMode ( Bool_t on = kTRUE)

Definition at line 530 of file TGo4AnalysisClientImp.cxx.

References fbCintMode, and fxAnalysis.

Referenced by TGo4AnalysisClient(), and Terminate().

◆ Start()

void TGo4AnalysisClient::Start ( )
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().

◆ StartObjectServer()

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().

◆ StartWorkThreads()

Int_t TGo4AnalysisClient::StartWorkThreads ( )
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().

◆ Stop()

void TGo4AnalysisClient::Stop ( )
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().

◆ StopObjectServer()

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().

◆ StopWorkThreads()

Int_t TGo4AnalysisClient::StopWorkThreads ( )
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().

◆ SubmitShutdown()

void TGo4AnalysisClient::SubmitShutdown ( )

◆ Terminate()

void TGo4AnalysisClient::Terminate ( Bool_t termapp = kTRUE)
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().

◆ TerminateFast()

void TGo4AnalysisClient::TerminateFast ( )
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().

◆ TestBufferUpdateConditions()

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().

◆ TestRatemeter()

Bool_t TGo4AnalysisClient::TestRatemeter ( )

Test if ratemeter has been updated.

Definition at line 416 of file TGo4AnalysisClientImp.cxx.

References fxRatemeter.

◆ UpdateRate()

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().

Referenced by Start(), and Stop().

◆ UpdateStatus()

void TGo4AnalysisClient::UpdateStatus ( TGo4TaskStatus * state)
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().

Field Documentation

◆ fbAutoStart

Bool_t TGo4AnalysisClient::fbAutoStart {kFALSE}
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().

◆ fbCintMode

Bool_t TGo4AnalysisClient::fbCintMode {kFALSE}
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().

◆ fbLoadPrefs

Bool_t TGo4AnalysisClient::fbLoadPrefs {kFALSE}
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().

◆ fbShowRate

Bool_t TGo4AnalysisClient::fbShowRate {kFALSE}
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().

◆ fcMainName

TString TGo4AnalysisClient::fcMainName
private

remember name of main thread

Definition at line 185 of file TGo4AnalysisClientImp.h.

Referenced by Constructor(), KillMain(), RestartMain(), Start(), StartWorkThreads(), StopWorkThreads(), and TerminateFast().

◆ fcWatchName

TString TGo4AnalysisClient::fcWatchName
private

remember name of watch thread

Definition at line 188 of file TGo4AnalysisClientImp.h.

Referenced by Constructor(), StartWorkThreads(), StopWorkThreads(), and TerminateFast().

◆ fdBufferUpdateTime

Double_t TGo4AnalysisClient::fdBufferUpdateTime {0}
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().

◆ fgcMAINTHREAD

const char * TGo4AnalysisClient::fgcMAINTHREAD = "MAIN-"
static

suffix for main thread name

Definition at line 154 of file TGo4AnalysisClientImp.h.

Referenced by Constructor().

◆ fgcWATCHTHREAD

const char * TGo4AnalysisClient::fgcWATCHTHREAD = "WATCH-"
static

suffix for watch thread name

Definition at line 157 of file TGo4AnalysisClientImp.h.

Referenced by Constructor().

◆ fgdSTATUSTIMEOUT

const Double_t TGo4AnalysisClient::fgdSTATUSTIMEOUT = 2
static

Maximum time (in s) between two updates of the client status object.

Definition at line 163 of file TGo4AnalysisClientImp.h.

Referenced by TestBufferUpdateConditions().

◆ fguCINTTIMERPERIOD

const UInt_t TGo4AnalysisClient::fguCINTTIMERPERIOD = 200
static

Timer period (in ms) for cint locking timer.

Definition at line 166 of file TGo4AnalysisClientImp.h.

◆ fguSTATUSUPDATE

const UInt_t TGo4AnalysisClient::fguSTATUSUPDATE = 1000
static

Number of mainloop runs between two updates of the client status object.

Definition at line 160 of file TGo4AnalysisClientImp.h.

Referenced by TestBufferUpdateConditions().

◆ fxAnalysis

TGo4Analysis* TGo4AnalysisClient::fxAnalysis {nullptr}
private

◆ fxHistoServer

TGo4HistogramServer* TGo4AnalysisClient::fxHistoServer {nullptr}
private

aggregation 1 histogram server (optional)

Definition at line 200 of file TGo4AnalysisClientImp.h.

Referenced by StartObjectServer(), and StopObjectServer().

◆ fxRatemeter

TGo4Ratemeter* TGo4AnalysisClient::fxRatemeter {nullptr}
private

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