TVirtualMonitoring.h

Go to the documentation of this file.
00001 // @(#)root/base:$Id: TVirtualMonitoring.h 23209 2008-04-14 13:25:09Z rdm $
00002 // Author: Andreas-Joachim Peters   15/05/2006
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TVirtualMonitoring
00013 #define ROOT_TVirtualMonitoring
00014 
00015 //////////////////////////////////////////////////////////////////////////
00016 //                                                                      //
00017 // TVirtualMonitoring                                                   //
00018 //                                                                      //
00019 // Provides the interface for Monitoring plugins.                       //
00020 //                                                                      //
00021 //////////////////////////////////////////////////////////////////////////
00022 
00023 #ifndef ROOT_TNamed
00024 #include "TNamed.h"
00025 #endif
00026 
00027 #ifndef ROOT_TList
00028 #include "TList.h"
00029 #endif
00030 #ifndef ROOT_TMap
00031 #include "TMap.h"
00032 #endif
00033 
00034 class TFile;
00035 
00036 class TVirtualMonitoringWriter : public TNamed {
00037 
00038 private:
00039 
00040    TVirtualMonitoringWriter(const TVirtualMonitoringWriter&); // Not implemented
00041    TVirtualMonitoringWriter& operator=(const TVirtualMonitoringWriter&); // Not implemented
00042 
00043    Double_t fValue;  // double monitor value
00044 
00045 protected:
00046    TList     *fTmpOpenPhases;       // To store open phases when there is not yet an object
00047 
00048 public:
00049    TVirtualMonitoringWriter() : TNamed(), fValue(0), fTmpOpenPhases(0) { }
00050    TVirtualMonitoringWriter(const char *name, Double_t value)
00051      : TNamed(name, ""), fValue(value), fTmpOpenPhases(0) { }
00052 
00053    virtual ~TVirtualMonitoringWriter() { if (fTmpOpenPhases) delete fTmpOpenPhases; }
00054 
00055    // TFile related info. In general they are gathered and sent only sometimes as summaries
00056    virtual Bool_t SendFileCloseEvent(TFile * /*file*/)
00057       { MayNotUse("SendFileCloseEvent"); return kFALSE; }
00058    virtual Bool_t SendFileReadProgress(TFile * /*file*/)
00059       { MayNotUse("SendFileReadProgress"); return kFALSE; }
00060    virtual Bool_t SendFileWriteProgress(TFile * /*file*/)
00061       { MayNotUse("SendFileWriteProgress"); return kFALSE; }
00062 
00063    virtual Bool_t SendParameters(TList * /*valuelist*/, const char * /*identifier*/ = 0)
00064       { MayNotUse("SendParameters"); return kFALSE; }
00065    virtual Bool_t SendInfoTime() { MayNotUse("SendInfoTime"); return kFALSE; }
00066    virtual Bool_t SendInfoUser(const char * /*user*/ = 0) { MayNotUse("SendInfoUser"); return kFALSE; }
00067    virtual Bool_t SendInfoDescription(const char * /*jobtag*/) { MayNotUse("SendInfoDescription"); return kFALSE; }
00068    virtual Bool_t SendInfoStatus(const char * /*status*/) { MayNotUse("SendInfoStatus"); return kFALSE; }
00069 
00070    // An Open might have several phases, and the timings might be interesting
00071    // to report
00072    // The info is only gathered into openphasestime, and sent when forcesend=kTRUE
00073    virtual Bool_t SendFileOpenProgress(TFile * /*file*/, TList * /*openphases*/,
00074                                        const char * /*openphasename*/,
00075                                        Bool_t /*forcesend*/ = kFALSE )
00076       { MayNotUse("SendFileOpenProgress"); return kFALSE; }
00077 
00078    virtual Bool_t SendProcessingStatus(const char * /*status*/, Bool_t /*restarttimer*/ = kFALSE)
00079       { MayNotUse("SendProcessingStatus"); return kFALSE; }
00080    virtual Bool_t SendProcessingProgress(Double_t /*nevent*/, Double_t /*nbytes*/, Bool_t /*force*/ = kFALSE)
00081       { MayNotUse("SendProcessingProgress"); return kFALSE; }
00082    virtual void   SetLogLevel(const char * /*loglevel*/ = "WARNING")
00083       { MayNotUse("SetLogLevel"); };
00084    virtual void   Verbose(Bool_t /*onoff*/) { MayNotUse("Verbose"); }
00085 
00086    ClassDef(TVirtualMonitoringWriter,0)  // ABC for Sending Monitoring Information
00087 };
00088 
00089 
00090 class TVirtualMonitoringReader : public TNamed {
00091 
00092 public:
00093    TVirtualMonitoringReader( const char * /*serviceurl*/ ="") { }
00094    virtual ~TVirtualMonitoringReader() { }
00095 
00096    virtual void   DumpResult() { MayNotUse("DumpResult"); }
00097    virtual void   GetValues(const char * /*farmName*/, const char * /*clusterName*/,
00098                             const char * /*nodeName*/, const char * /*paramName*/,
00099                             Long_t /*min*/, Long_t /*max*/, Bool_t /*debug*/ = kFALSE)
00100       { MayNotUse("GetValues"); }
00101    virtual void   GetLastValues(const char * /*farmName*/, const char * /*clusterName*/,
00102                                 const char * /*nodeName*/, const char * /*paramName*/,
00103                                 Bool_t /*debug*/ =kFALSE)
00104       { MayNotUse("GetLastValues"); }
00105    virtual void   ProxyValues(const char * /*farmName*/, const char * /*clusterName*/,
00106                               const char * /*nodeName*/, const char * /*paramName*/,
00107                               Long_t /*min*/, Long_t /*max*/, Long_t /*lifetime*/)
00108       { MayNotUse("ProxyValues"); }
00109 
00110    virtual TMap *GetMap() { MayNotUse("GetMap"); return 0; }
00111    virtual void DeleteMap(TMap * /*map*/) { MayNotUse("DeleteMap"); }
00112 
00113    ClassDef(TVirtualMonitoringReader, 1) // ABC for Reading Monitoring Information
00114 };
00115 
00116 
00117 R__EXTERN TVirtualMonitoringWriter *gMonitoringWriter;
00118 R__EXTERN TVirtualMonitoringReader *gMonitoringReader;
00119 
00120 
00121 #endif

Generated on Tue Jul 5 14:10:33 2011 for ROOT_528-00b_version by  doxygen 1.5.1