GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
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 ()
 
TGo4AnalysisGetAnalysis () const
 
void Start () override
 
void Stop () override
 
void Quit () override
 
void KillMain () override
 
void RestartMain () override
 
TGo4TaskStatusCreateStatus () override
 
Int_t Initialization () override
 
void SendAnalysisObject (const char *name)
 
void SendAnalysisStatus ()
 
void SendAnalysisClientStatus ()
 
void SendNamesList ()
 
void UpdateRate (Int_t counts=1)
 
UInt_t GetCurrentCount () const
 
Bool_t TestRatemeter ()
 
Bool_t TestBufferUpdateConditions ()
 
void StartObjectServer (const char *basename, const char *passwd)
 
void StopObjectServer ()
 
Int_t StartWorkThreads () override
 
Int_t StopWorkThreads () override
 
void Terminate (Bool_t termapp=kTRUE) override
 
void TerminateFast () override
 
void SubmitShutdown ()
 
void SendStatusMessage (Int_t level, Bool_t printout, const TString &text) override
 
void ExecuteString (const char *command) override
 
void SetCintMode (Bool_t on=kTRUE)
 
Bool_t IsCintMode () const
 
- 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 ()
 
Bool_t MainIsRunning () const
 
TGo4CommandNextCommand ()
 
void SendObject (TObject *obj, const char *receiver=nullptr)
 
void SendStatus (TGo4Status *stat, const char *receiver=nullptr)
 
TGo4ThreadHandlerGetThreadHandler ()
 
void SendStatusBuffer ()
 
void UpdateStatusBuffer ()
 
- Public Member Functions inherited from TGo4TaskOwner
 TGo4TaskOwner ()
 
 TGo4TaskOwner (Bool_t isserver)
 
virtual ~TGo4TaskOwner ()
 
Bool_t IsServer () const
 
TGo4TaskGetTask () const
 
const char * GetName () const
 
Bool_t IsConnected ()
 
Bool_t IsBeingQuit ()
 
TMutex * GetTaskManagerMutex ()
 
- Public Member Functions inherited from TGo4CommandReceiver
 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) override
 
 TGo4AnalysisClient ()
 

Private Attributes

TGo4AnalysisfxAnalysis {nullptr}
 
TString fcMainName
 
TString fcWatchName
 
Double_t fdBufferUpdateTime {0}
 
TGo4RatemeterfxRatemeter {nullptr}
 
TGo4HistogramServerfxHistoServer {nullptr}
 
Bool_t fbAutoStart {kFALSE}
 
Bool_t fbCintMode {kFALSE}
 
Bool_t fbLoadPrefs {kFALSE}
 
Bool_t fbShowRate {kFALSE}
 

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

Member Function Documentation

◆ Constructor()

void TGo4AnalysisClient::Constructor ( Bool_t  starthistserv = kFALSE,
const char *  basename = "Go4",
const char *  passwd = "abcd" 
)
private

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

Referenced by GetAnalysis().

◆ 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 TGo4Analysis::ExecuteLine(), fxAnalysis, StartObjectServer(), and StopObjectServer().

Referenced by GetAnalysis().

◆ 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, and TGo4Ratemeter::GetCurrentCount().

Referenced by GetAnalysis(), and 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(), TGo4Analysis::InitEventClasses(), TGo4Analysis::IsAutoSaveOn(), IsCintMode(), TGo4Analysis::LoadObjects(), TGo4Analysis::LoadStatus(), SendAnalysisStatus(), SendStatusMessage(), Start(), TGo4Slave::Stop(), and TGo4Slave::UpdateStatusBuffer().

Referenced by GetAnalysis().

◆ IsCintMode()

Bool_t TGo4AnalysisClient::IsCintMode ( ) const
inline

Definition at line 151 of file TGo4AnalysisClientImp.h.

References fbCintMode.

Referenced by Initialization(), and TGo4AnalysisMainRunnable::Run().

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

Referenced by GetAnalysis().

◆ 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 TGo4Analysis::CloseAnalysis(), fxAnalysis, and Stop().

Referenced by TGo4Sniffer::CmdExit(), and GetAnalysis().

◆ 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(), TGo4Ratemeter::Reset(), SendStatusMessage(), TGo4ThreadHandler::Start(), TGo4ThreadHandler::Stop(), and TGo4Task::WakeCommandQueue().

Referenced by GetAnalysis().

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

Referenced by GetAnalysis(), and TGo4AnalysisWatchRunnable::Run().

◆ 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, TGo4Analysis::GetObject(), GO4TRACE, and TGo4Slave::SendObject().

Referenced by GetAnalysis().

◆ 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 GetAnalysis(), and 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, TGo4Analysis::GetNamesList(), GO4TRACE, TGo4Slave::SendObject(), SendStatusMessage(), and TGo4Analysis::UpdateNamesList().

Referenced by GetAnalysis().

◆ SendStatusMessage()

void TGo4AnalysisClient::SendStatusMessage ( Int_t  level,
Bool_t  printout,
const TString &  text 
)
overridevirtual

◆ SetCintMode()

void TGo4AnalysisClient::SetCintMode ( Bool_t  on = kTRUE)

◆ Start()

void TGo4AnalysisClient::Start ( )
overridevirtual

◆ 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(), ExecuteString(), and GetAnalysis().

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

Referenced by GetAnalysis().

◆ Stop()

void TGo4AnalysisClient::Stop ( )
overridevirtual

◆ StopObjectServer()

void TGo4AnalysisClient::StopObjectServer ( )

Stop the object (histogram) server.

Definition at line 446 of file TGo4AnalysisClientImp.cxx.

References fxHistoServer.

Referenced by ExecuteString(), GetAnalysis(), StartObjectServer(), Terminate(), TerminateFast(), and ~TGo4AnalysisClient().

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

Referenced by GetAnalysis().

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

Referenced by GetAnalysis().

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

Referenced by GetAnalysis().

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

Referenced by GetAnalysis(), and TGo4Analysis::MainCycle().

◆ TestRatemeter()

Bool_t TGo4AnalysisClient::TestRatemeter ( )

Test if ratemeter has been updated.

Definition at line 416 of file TGo4AnalysisClientImp.cxx.

References fxRatemeter, and TGo4Ratemeter::TestUpdate().

Referenced by GetAnalysis(), and TGo4AnalysisWatchRunnable::Run().

◆ UpdateRate()

void TGo4AnalysisClient::UpdateRate ( Int_t  counts = 1)

◆ UpdateStatus()

void TGo4AnalysisClient::UpdateStatus ( TGo4TaskStatus state)
overrideprivatevirtual

Member Data 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 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 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 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 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 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

◆ fxRatemeter

TGo4Ratemeter* TGo4AnalysisClient::fxRatemeter {nullptr}
private

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