Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes

TGo4AnalysisClient Class Reference

#include <TGo4AnalysisClientImp.h>

Inheritance diagram for TGo4AnalysisClient:
TGo4Slave TGo4TaskOwner TGo4CommandReceiver

List of all members.

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
virtual void Start ()
virtual void Stop ()
virtual void Quit ()
virtual void KillMain ()
virtual void RestartMain ()
virtual TGo4TaskStatusCreateStatus ()
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
void LockAll ()
void UnLockAll ()

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

TGo4AnalysisfxAnalysis
TString fcMainName
TString fcWatchName
Double_t fdBufferUpdateTime
TGo4RatemeterfxRatemeter
TGo4HistogramServerfxHistoServer
Bool_t fbAutoStart
Bool_t fbCintMode
TTimer * fxCintLockTimer
Bool_t fbLoadPrefs
Bool_t fbShowRate

Detailed Description

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

Definition at line 34 of file TGo4AnalysisClientImp.h.


Constructor & Destructor Documentation

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::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 (  )  [private]

Member Function Documentation

TGo4TaskStatus * TGo4AnalysisClient::CreateStatus (  )  [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 271 of file TGo4AnalysisClientImp.cxx.

References TGo4TaskOwner::GetName(), GO4TRACE, and UpdateStatus().

void TGo4AnalysisClient::ExecuteString ( const char *  command  )  [virtual]

Execute string command. Overrides base class implementation to decouple some commands from analysis client.

Reimplemented from TGo4Slave.

Definition at line 519 of file TGo4AnalysisClientImp.cxx.

References StartObjectServer(), and StopObjectServer().

UInt_t TGo4AnalysisClient::GetCurrentCount (  ) 

Number of currently processed events since last start.

Definition at line 428 of file TGo4AnalysisClientImp.cxx.

References fxRatemeter, and TGo4Ratemeter::GetCurrentCount().

Referenced by TestBufferUpdateConditions().

Int_t TGo4AnalysisClient::Initialization (  )  [virtual]
Bool_t TGo4AnalysisClient::IsCintMode (  )  const [inline]

Definition at line 151 of file TGo4AnalysisClientImp.h.

References fbCintMode.

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

void TGo4AnalysisClient::KillMain (  )  [virtual]

Kill the main thread; method to be called from command, should be overridden in user implementation

Reimplemented from TGo4Slave.

Definition at line 355 of file TGo4AnalysisClientImp.cxx.

References TGo4ThreadHandler::Cancel(), fcMainName, TGo4TaskOwner::GetName(), TGo4TaskOwner::GetTask(), TGo4Slave::GetThreadHandler(), GO4TRACE, SendStatusMessage(), TGo4ThreadHandler::Stop(), and TGo4Task::WakeCommandQueue().

void TGo4AnalysisClient::LockAll (  ) 

Lock all go4 mutexes in correct order to avoid deadlocking. to be used from cintlocktimer

Definition at line 608 of file TGo4AnalysisClientImp.cxx.

References TGo4TaskOwner::GetTask(), and TGo4Task::LockAll().

Referenced by TGo4CintLockTimer::Notify().

void TGo4AnalysisClient::Quit (  )  [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 475 of file TGo4AnalysisClientImp.cxx.

References TGo4Analysis::CloseAnalysis(), fxAnalysis, and Stop().

void TGo4AnalysisClient::RestartMain (  )  [virtual]
void TGo4AnalysisClient::SendAnalysisClientStatus (  ) 

Send a complete status object of the analysis client via the status queue.

Definition at line 324 of file TGo4AnalysisClientImp.cxx.

References TGo4Log::Debug(), GO4TRACE, and TGo4Slave::SendStatusBuffer().

Referenced by Initialization(), TGo4AnalysisWatchRunnable::Run(), Start(), and Stop().

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 302 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 309 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 337 of file TGo4AnalysisClientImp.cxx.

References TGo4Log::Debug(), fxAnalysis, TGo4Analysis::GetNamesList(), GO4TRACE, TGo4Slave::SendObject(), SendStatusMessage(), and TGo4Analysis::UpdateNamesList().

void TGo4AnalysisClient::SetCintMode ( Bool_t  on = kTRUE  ) 
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 454 of file TGo4AnalysisClientImp.cxx.

References fxHistoServer, and StopObjectServer().

Referenced by Constructor(), and ExecuteString().

Int_t TGo4AnalysisClient::StartWorkThreads (  )  [virtual]

start the working threads of the slave implementation;

Reimplemented from TGo4TaskOwner.

Definition at line 557 of file TGo4AnalysisClientImp.cxx.

References fcMainName, fcWatchName, TGo4Slave::GetThreadHandler(), and TGo4ThreadHandler::Start().

void TGo4AnalysisClient::Stop (  )  [virtual]
void TGo4AnalysisClient::StopObjectServer (  ) 

Stop the object (histogram) server.

Definition at line 464 of file TGo4AnalysisClientImp.cxx.

References fxHistoServer.

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

Int_t TGo4AnalysisClient::StopWorkThreads (  )  [virtual]

stop the working threads of the slave implementation;

Reimplemented from TGo4TaskOwner.

Definition at line 568 of file TGo4AnalysisClientImp.cxx.

References fcMainName, fcWatchName, TGo4Slave::GetThreadHandler(), and TGo4ThreadHandler::Stop().

void TGo4AnalysisClient::SubmitShutdown (  ) 
void TGo4AnalysisClient::Terminate ( Bool_t  termapp = kTRUE  )  [virtual]

Overwrites the Threadmanager Terminate to shutdown the objectserver properly

Reimplemented from TGo4Slave.

Definition at line 484 of file TGo4AnalysisClientImp.cxx.

References TGo4TaskOwner::GetTask(), SetCintMode(), and StopObjectServer().

void TGo4AnalysisClient::TerminateFast (  )  [virtual]

Overwrites the Threadmanager TerminateFast to shutdown the objectserver properly

Reimplemented from TGo4Slave.

Definition at line 492 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 438 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 433 of file TGo4AnalysisClientImp.cxx.

References fxRatemeter, and TGo4Ratemeter::TestUpdate().

Referenced by TGo4AnalysisWatchRunnable::Run().

void TGo4AnalysisClient::UnLockAll (  ) 

UnLock all go4 mutexes in correct order to avoid deadlocking to be used from cintlocktimer

Definition at line 614 of file TGo4AnalysisClientImp.cxx.

References TGo4TaskOwner::GetTask(), and TGo4Task::UnLockAll().

Referenced by TGo4CintLockTimer::Notify(), and TGo4CintLockTimer::~TGo4CintLockTimer().

void TGo4AnalysisClient::UpdateRate ( Int_t  counts = 1  ) 
void TGo4AnalysisClient::UpdateStatus ( TGo4TaskStatus state  )  [private, virtual]

Member Data Documentation

If true, this slave will initialize and start analysis immediately without waiting for a submit/start command.

Definition at line 214 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 218 of file TGo4AnalysisClientImp.h.

Referenced by IsCintMode(), and SetCintMode().

If true, this slave load preferences for analysis from default file.

Definition at line 226 of file TGo4AnalysisClientImp.h.

Referenced by Initialization().

Then enabled, show current rate on the analysis terminal window

Definition at line 229 of file TGo4AnalysisClientImp.h.

Referenced by UpdateRate().

TString TGo4AnalysisClient::fcMainName [private]

remember name of main thread

Definition at line 195 of file TGo4AnalysisClientImp.h.

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

remember name of watch thread

Definition at line 198 of file TGo4AnalysisClientImp.h.

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

absoulute time of the last status buffer update. Reset by TestBufferUpdateCondition

Definition at line 201 of file TGo4AnalysisClientImp.h.

Referenced by Start(), and TestBufferUpdateConditions().

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

suffix for main thread name

Definition at line 162 of file TGo4AnalysisClientImp.h.

Referenced by Constructor().

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

suffix for watch thread name

Definition at line 165 of file TGo4AnalysisClientImp.h.

Referenced by Constructor().

const Double_t TGo4AnalysisClient::fgdSTATUSTIMEOUT = 2 [static]

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

Definition at line 171 of file TGo4AnalysisClientImp.h.

Referenced by TestBufferUpdateConditions().

const UInt_t TGo4AnalysisClient::fguCINTTIMERPERIOD = 200 [static]

Timer period (in ms) for cint locking timer

Definition at line 174 of file TGo4AnalysisClientImp.h.

Referenced by SetCintMode().

const UInt_t TGo4AnalysisClient::fguSTATUSUPDATE = 1000 [static]

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

Definition at line 168 of file TGo4AnalysisClientImp.h.

Referenced by TestBufferUpdateConditions().

For cintmode, we only allow to release the main lock within a certain time window, triggered by this timer

Definition at line 223 of file TGo4AnalysisClientImp.h.

Referenced by SetCintMode(), and ~TGo4AnalysisClient().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines