GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
TGo4Ratemeter Class Reference

#include <TGo4Ratemeter.h>

+ Inheritance diagram for TGo4Ratemeter:

Public Member Functions

 TGo4Ratemeter ()
 
virtual ~TGo4Ratemeter ()
 
Bool_t IsRunning () const
 
Double_t GetRate () const
 
Double_t GetTime () const
 
ULong64_t GetCurrentCount () const
 
Double_t GetAvRate () const
 
const char * GetDateTime () const
 
const char * GetCurrentSource () const
 
void UpdateFrom (const TGo4Ratemeter *r)
 
Bool_t Update (Int_t increment=1)
 
void SetRunning (Bool_t on=kTRUE)
 
void SetDateTime (const char *str)
 
void SetCurrentSource (const char *str)
 
void Reset ()
 
Bool_t TestUpdate ()
 
void SetUpdateInterval (double v)
 

Private Attributes

Bool_t fbRunning
 
ULong64_t fuCurrentCount
 
Double_t fdRate
 
Double_t fdTime
 
TString fxDateString
 
TString fxEventSource
 
ULong64_t fuLastCount
 
TTimeStamp fLastTm
 Number of events processed at last ratemeter update. More...
 
Bool_t fbUpdateDone
 Time when last rate measurement was done. More...
 
ULong64_t fuNextCheckCnt
 True if update has been performed since last TestZero call. More...
 
ULong64_t fuCheckInterval
 Next counter value when time will be checked. More...
 
Double_t fdUpdateInterval
 How often time should be checked. More...
 

Static Private Attributes

static const Double_t fgdUPDATEINTERVAL = 1.0
 Configured interval in seconds before two updates. More...
 

Detailed Description

Class containing event counter and ratemeter services.

Definition at line 24 of file TGo4Ratemeter.h.

Constructor & Destructor Documentation

TGo4Ratemeter::TGo4Ratemeter ( )

Definition at line 19 of file TGo4Ratemeter.cxx.

TGo4Ratemeter::~TGo4Ratemeter ( )
virtual

Definition at line 36 of file TGo4Ratemeter.cxx.

Member Function Documentation

Double_t TGo4Ratemeter::GetAvRate ( ) const
inline
ULong64_t TGo4Ratemeter::GetCurrentCount ( ) const
inline
const char* TGo4Ratemeter::GetCurrentSource ( ) const
inline

Definition at line 60 of file TGo4Ratemeter.h.

Referenced by TGo4AnalysisStatusMonitor::linkedObjectUpdated().

const char* TGo4Ratemeter::GetDateTime ( ) const
inline

Definition at line 58 of file TGo4Ratemeter.h.

Referenced by TGo4AnalysisStatusMonitor::linkedObjectUpdated().

Double_t TGo4Ratemeter::GetRate ( ) const
inline
Double_t TGo4Ratemeter::GetTime ( ) const
inline
Bool_t TGo4Ratemeter::IsRunning ( ) const
inline

Definition at line 48 of file TGo4Ratemeter.h.

References fbRunning.

Referenced by TGo4AnalysisStatusMonitor::linkedObjectUpdated().

void TGo4Ratemeter::Reset ( )
void TGo4Ratemeter::SetCurrentSource ( const char *  str)
inline
void TGo4Ratemeter::SetDateTime ( const char *  str)
inline
void TGo4Ratemeter::SetRunning ( Bool_t  on = kTRUE)
inline
void TGo4Ratemeter::SetUpdateInterval ( double  v)
inline

Set update interval in seconds - default is 1

Definition at line 82 of file TGo4Ratemeter.h.

Referenced by TGo4Analysis::RunImplicitLoop().

Bool_t TGo4Ratemeter::TestUpdate ( )

Test if update has been called since last test.. To be called from watch thread to check if main thread is still active. If not, watch thread has to update status and rate itself.

Definition at line 112 of file TGo4Ratemeter.cxx.

References fbUpdateDone.

Referenced by TGo4AnalysisClient::TestRatemeter().

Bool_t TGo4Ratemeter::Update ( Int_t  increment = 1)

Update counter and rate values. Parameter increment may specify the number of counts to add before the new rate is calculated. Return kTRUE if new rate is calculated

Definition at line 67 of file TGo4Ratemeter.cxx.

References fbRunning, fbUpdateDone, fdRate, fdTime, fdUpdateInterval, fLastTm, fuCheckInterval, fuCurrentCount, fuLastCount, and fuNextCheckCnt.

Referenced by TGo4Analysis::RunImplicitLoop(), and TGo4AnalysisClient::UpdateRate().

void TGo4Ratemeter::UpdateFrom ( const TGo4Ratemeter r)

Definition at line 40 of file TGo4Ratemeter.cxx.

References fbRunning, fdRate, fdTime, fuCurrentCount, fxDateString, and fxEventSource.

Referenced by TGo4Sniffer::RatemeterUpdate().

Member Data Documentation

Bool_t TGo4Ratemeter::fbRunning
private

Definition at line 26 of file TGo4Ratemeter.h.

Referenced by IsRunning(), Reset(), Update(), and UpdateFrom().

Bool_t TGo4Ratemeter::fbUpdateDone
private

Time when last rate measurement was done.

Definition at line 35 of file TGo4Ratemeter.h.

Referenced by Reset(), TestUpdate(), and Update().

Double_t TGo4Ratemeter::fdRate
private

Definition at line 28 of file TGo4Ratemeter.h.

Referenced by GetRate(), Reset(), Update(), and UpdateFrom().

Double_t TGo4Ratemeter::fdTime
private

Definition at line 29 of file TGo4Ratemeter.h.

Referenced by GetTime(), Reset(), Update(), and UpdateFrom().

Double_t TGo4Ratemeter::fdUpdateInterval
private

How often time should be checked.

Definition at line 39 of file TGo4Ratemeter.h.

Referenced by Update().

const Double_t TGo4Ratemeter::fgdUPDATEINTERVAL = 1.0
staticprivate

Configured interval in seconds before two updates.

Definition at line 41 of file TGo4Ratemeter.h.

TTimeStamp TGo4Ratemeter::fLastTm
private

Number of events processed at last ratemeter update.

Definition at line 34 of file TGo4Ratemeter.h.

Referenced by Reset(), and Update().

ULong64_t TGo4Ratemeter::fuCheckInterval
private

Next counter value when time will be checked.

Definition at line 38 of file TGo4Ratemeter.h.

Referenced by Reset(), and Update().

ULong64_t TGo4Ratemeter::fuCurrentCount
private

Definition at line 27 of file TGo4Ratemeter.h.

Referenced by GetCurrentCount(), Reset(), Update(), and UpdateFrom().

ULong64_t TGo4Ratemeter::fuLastCount
private

Definition at line 33 of file TGo4Ratemeter.h.

Referenced by Reset(), and Update().

ULong64_t TGo4Ratemeter::fuNextCheckCnt
private

True if update has been performed since last TestZero call.

Definition at line 37 of file TGo4Ratemeter.h.

Referenced by Reset(), and Update().

TString TGo4Ratemeter::fxDateString
private

Definition at line 30 of file TGo4Ratemeter.h.

Referenced by UpdateFrom().

TString TGo4Ratemeter::fxEventSource
private

Definition at line 31 of file TGo4Ratemeter.h.

Referenced by UpdateFrom().


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