GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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
 
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
 
- 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 ()
 
TGo4CommandNextCommand ()
 
void SendObject (TObject *obj, const char *receiver=0)
 
void SendStatus (TGo4Status *stat, const char *receiver=0)
 
TGo4ThreadHandlerGetThreadHandler ()
 
void SendStatusBuffer ()
 
void UpdateStatusBuffer ()
 
- Public Member Functions inherited from TGo4TaskOwner
 TGo4TaskOwner ()
 
 TGo4TaskOwner (Bool_t isserver)
 
virtual ~TGo4TaskOwner ()
 
Bool_t IsServer ()
 
TGo4TaskGetTask ()
 
const char * GetName () const
 
Bool_t IsConnected ()
 
Bool_t IsBeingQuit ()
 
TMutex * GetTaskManagerMutex ()
 
- Public Member Functions inherited from TGo4CommandReceiver
virtual ~TGo4CommandReceiver ()
 
 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

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

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::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 ( )
virtual
TGo4AnalysisClient::TGo4AnalysisClient ( )
private

Member Function Documentation

void TGo4AnalysisClient::Constructor ( Bool_t  starthistserv = kFALSE,
const char *  basename = "Go4",
const char *  passwd = "abcd" 
)
private
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 272 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 527 of file TGo4AnalysisClientImp.cxx.

References TGo4Analysis::ExecuteLine(), fxAnalysis, StartObjectServer(), and StopObjectServer().

TGo4Analysis* TGo4AnalysisClient::GetAnalysis ( ) const
inline
UInt_t TGo4AnalysisClient::GetCurrentCount ( )

Number of currently processed events since last start.

Definition at line 436 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 356 of file TGo4AnalysisClientImp.cxx.

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

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 483 of file TGo4AnalysisClientImp.cxx.

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

Referenced by TGo4Sniffer::CmdExit().

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

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

Definition at line 325 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 303 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 310 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 338 of file TGo4AnalysisClientImp.cxx.

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

void TGo4AnalysisClient::SendStatusMessage ( Int_t  level,
Bool_t  printout,
const TString &  text 
)
virtual
void TGo4AnalysisClient::SetCintMode ( Bool_t  on = kTRUE)

Definition at line 569 of file TGo4AnalysisClientImp.cxx.

References fbCintMode, fxAnalysis, and TGo4Analysis::SetAutoSave().

Referenced by main(), Terminate(), and TGo4AnalysisClient().

void TGo4AnalysisClient::Start ( )
virtual
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 462 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 547 of file TGo4AnalysisClientImp.cxx.

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

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

Stop the object (histogram) server.

Definition at line 472 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 558 of file TGo4AnalysisClientImp.cxx.

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

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 492 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 500 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 446 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 441 of file TGo4AnalysisClientImp.cxx.

References fxRatemeter, and TGo4Ratemeter::TestUpdate().

Referenced by TGo4AnalysisWatchRunnable::Run().

void TGo4AnalysisClient::UpdateRate ( Int_t  counts = 1)
void TGo4AnalysisClient::UpdateStatus ( TGo4TaskStatus state)
privatevirtual

Member Data Documentation

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

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

Bool_t TGo4AnalysisClient::fbLoadPrefs
private

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

Definition at line 213 of file TGo4AnalysisClientImp.h.

Referenced by Initialization().

Bool_t TGo4AnalysisClient::fbShowRate
private

Then enabled, show current rate on the analysis terminal window

Definition at line 216 of file TGo4AnalysisClientImp.h.

Referenced by UpdateRate().

TString TGo4AnalysisClient::fcMainName
private

remember name of main thread

Definition at line 187 of file TGo4AnalysisClientImp.h.

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

TString TGo4AnalysisClient::fcWatchName
private

remember name of watch thread

Definition at line 190 of file TGo4AnalysisClientImp.h.

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

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

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

suffix for main thread name

Definition at line 154 of file TGo4AnalysisClientImp.h.

Referenced by Constructor().

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

suffix for watch thread name

Definition at line 157 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 163 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 166 of file TGo4AnalysisClientImp.h.

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

TGo4Analysis* TGo4AnalysisClient::fxAnalysis
private
TGo4HistogramServer* TGo4AnalysisClient::fxHistoServer
private
TGo4Ratemeter* TGo4AnalysisClient::fxRatemeter
private

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