ROOT logo
// @(#)root/base:$Id$
// Author: Andreas-Joachim Peters   15/05/2006

/*************************************************************************
 * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TVirtualMonitoring
#define ROOT_TVirtualMonitoring

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TVirtualMonitoring                                                   //
//                                                                      //
// Provides the interface for Monitoring plugins.                       //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TNamed
#include "TNamed.h"
#endif

#ifndef ROOT_TList
#include "TList.h"
#endif
#ifndef ROOT_TMap
#include "TMap.h"
#endif

class TFile;

class TVirtualMonitoringWriter : public TNamed {

private:

   TVirtualMonitoringWriter(const TVirtualMonitoringWriter&); // Not implemented
   TVirtualMonitoringWriter& operator=(const TVirtualMonitoringWriter&); // Not implemented

   Double_t fValue;  // double monitor value

protected:
   TList     *fTmpOpenPhases;       // To store open phases when there is not yet an object

public:
   TVirtualMonitoringWriter() : TNamed(), fValue(0), fTmpOpenPhases(0) { }
   TVirtualMonitoringWriter(const char *name, Double_t value)
     : TNamed(name, ""), fValue(value), fTmpOpenPhases(0) { }

   virtual ~TVirtualMonitoringWriter() { if (fTmpOpenPhases) delete fTmpOpenPhases; }

   // TFile related info. In general they are gathered and sent only sometimes as summaries
   virtual Bool_t SendFileCloseEvent(TFile * /*file*/)
      { MayNotUse("SendFileCloseEvent"); return kFALSE; }
   virtual Bool_t SendFileReadProgress(TFile * /*file*/)
      { MayNotUse("SendFileReadProgress"); return kFALSE; }
   virtual Bool_t SendFileWriteProgress(TFile * /*file*/)
      { MayNotUse("SendFileWriteProgress"); return kFALSE; }

   virtual Bool_t SendParameters(TList * /*valuelist*/, const char * /*identifier*/ = 0)
      { MayNotUse("SendParameters"); return kFALSE; }
   virtual Bool_t SendInfoTime() { MayNotUse("SendInfoTime"); return kFALSE; }
   virtual Bool_t SendInfoUser(const char * /*user*/ = 0) { MayNotUse("SendInfoUser"); return kFALSE; }
   virtual Bool_t SendInfoDescription(const char * /*jobtag*/) { MayNotUse("SendInfoDescription"); return kFALSE; }
   virtual Bool_t SendInfoStatus(const char * /*status*/) { MayNotUse("SendInfoStatus"); return kFALSE; }

   // An Open might have several phases, and the timings might be interesting
   // to report
   // The info is only gathered into openphasestime, and sent when forcesend=kTRUE
   virtual Bool_t SendFileOpenProgress(TFile * /*file*/, TList * /*openphases*/,
                                       const char * /*openphasename*/,
                                       Bool_t /*forcesend*/ = kFALSE )
      { MayNotUse("SendFileOpenProgress"); return kFALSE; }

   virtual Bool_t SendProcessingStatus(const char * /*status*/, Bool_t /*restarttimer*/ = kFALSE)
      { MayNotUse("SendProcessingStatus"); return kFALSE; }
   virtual Bool_t SendProcessingProgress(Double_t /*nevent*/, Double_t /*nbytes*/, Bool_t /*force*/ = kFALSE)
      { MayNotUse("SendProcessingProgress"); return kFALSE; }
   virtual void   SetLogLevel(const char * /*loglevel*/ = "WARNING")
      { MayNotUse("SetLogLevel"); };
   virtual void   Verbose(Bool_t /*onoff*/) { MayNotUse("Verbose"); }

   ClassDef(TVirtualMonitoringWriter,0)  // ABC for Sending Monitoring Information
};


class TVirtualMonitoringReader : public TNamed {

public:
   TVirtualMonitoringReader( const char * /*serviceurl*/ ="") { }
   virtual ~TVirtualMonitoringReader() { }

   virtual void   DumpResult() { MayNotUse("DumpResult"); }
   virtual void   GetValues(const char * /*farmName*/, const char * /*clusterName*/,
                            const char * /*nodeName*/, const char * /*paramName*/,
                            Long_t /*min*/, Long_t /*max*/, Bool_t /*debug*/ = kFALSE)
      { MayNotUse("GetValues"); }
   virtual void   GetLastValues(const char * /*farmName*/, const char * /*clusterName*/,
                                const char * /*nodeName*/, const char * /*paramName*/,
                                Bool_t /*debug*/ =kFALSE)
      { MayNotUse("GetLastValues"); }
   virtual void   ProxyValues(const char * /*farmName*/, const char * /*clusterName*/,
                              const char * /*nodeName*/, const char * /*paramName*/,
                              Long_t /*min*/, Long_t /*max*/, Long_t /*lifetime*/)
      { MayNotUse("ProxyValues"); }

   virtual TMap *GetMap() { MayNotUse("GetMap"); return 0; }
   virtual void DeleteMap(TMap * /*map*/) { MayNotUse("DeleteMap"); }

   ClassDef(TVirtualMonitoringReader, 1) // ABC for Reading Monitoring Information
};


R__EXTERN TVirtualMonitoringWriter *gMonitoringWriter;
R__EXTERN TVirtualMonitoringReader *gMonitoringReader;


#endif
 TVirtualMonitoring.h:1
 TVirtualMonitoring.h:2
 TVirtualMonitoring.h:3
 TVirtualMonitoring.h:4
 TVirtualMonitoring.h:5
 TVirtualMonitoring.h:6
 TVirtualMonitoring.h:7
 TVirtualMonitoring.h:8
 TVirtualMonitoring.h:9
 TVirtualMonitoring.h:10
 TVirtualMonitoring.h:11
 TVirtualMonitoring.h:12
 TVirtualMonitoring.h:13
 TVirtualMonitoring.h:14
 TVirtualMonitoring.h:15
 TVirtualMonitoring.h:16
 TVirtualMonitoring.h:17
 TVirtualMonitoring.h:18
 TVirtualMonitoring.h:19
 TVirtualMonitoring.h:20
 TVirtualMonitoring.h:21
 TVirtualMonitoring.h:22
 TVirtualMonitoring.h:23
 TVirtualMonitoring.h:24
 TVirtualMonitoring.h:25
 TVirtualMonitoring.h:26
 TVirtualMonitoring.h:27
 TVirtualMonitoring.h:28
 TVirtualMonitoring.h:29
 TVirtualMonitoring.h:30
 TVirtualMonitoring.h:31
 TVirtualMonitoring.h:32
 TVirtualMonitoring.h:33
 TVirtualMonitoring.h:34
 TVirtualMonitoring.h:35
 TVirtualMonitoring.h:36
 TVirtualMonitoring.h:37
 TVirtualMonitoring.h:38
 TVirtualMonitoring.h:39
 TVirtualMonitoring.h:40
 TVirtualMonitoring.h:41
 TVirtualMonitoring.h:42
 TVirtualMonitoring.h:43
 TVirtualMonitoring.h:44
 TVirtualMonitoring.h:45
 TVirtualMonitoring.h:46
 TVirtualMonitoring.h:47
 TVirtualMonitoring.h:48
 TVirtualMonitoring.h:49
 TVirtualMonitoring.h:50
 TVirtualMonitoring.h:51
 TVirtualMonitoring.h:52
 TVirtualMonitoring.h:53
 TVirtualMonitoring.h:54
 TVirtualMonitoring.h:55
 TVirtualMonitoring.h:56
 TVirtualMonitoring.h:57
 TVirtualMonitoring.h:58
 TVirtualMonitoring.h:59
 TVirtualMonitoring.h:60
 TVirtualMonitoring.h:61
 TVirtualMonitoring.h:62
 TVirtualMonitoring.h:63
 TVirtualMonitoring.h:64
 TVirtualMonitoring.h:65
 TVirtualMonitoring.h:66
 TVirtualMonitoring.h:67
 TVirtualMonitoring.h:68
 TVirtualMonitoring.h:69
 TVirtualMonitoring.h:70
 TVirtualMonitoring.h:71
 TVirtualMonitoring.h:72
 TVirtualMonitoring.h:73
 TVirtualMonitoring.h:74
 TVirtualMonitoring.h:75
 TVirtualMonitoring.h:76
 TVirtualMonitoring.h:77
 TVirtualMonitoring.h:78
 TVirtualMonitoring.h:79
 TVirtualMonitoring.h:80
 TVirtualMonitoring.h:81
 TVirtualMonitoring.h:82
 TVirtualMonitoring.h:83
 TVirtualMonitoring.h:84
 TVirtualMonitoring.h:85
 TVirtualMonitoring.h:86
 TVirtualMonitoring.h:87
 TVirtualMonitoring.h:88
 TVirtualMonitoring.h:89
 TVirtualMonitoring.h:90
 TVirtualMonitoring.h:91
 TVirtualMonitoring.h:92
 TVirtualMonitoring.h:93
 TVirtualMonitoring.h:94
 TVirtualMonitoring.h:95
 TVirtualMonitoring.h:96
 TVirtualMonitoring.h:97
 TVirtualMonitoring.h:98
 TVirtualMonitoring.h:99
 TVirtualMonitoring.h:100
 TVirtualMonitoring.h:101
 TVirtualMonitoring.h:102
 TVirtualMonitoring.h:103
 TVirtualMonitoring.h:104
 TVirtualMonitoring.h:105
 TVirtualMonitoring.h:106
 TVirtualMonitoring.h:107
 TVirtualMonitoring.h:108
 TVirtualMonitoring.h:109
 TVirtualMonitoring.h:110
 TVirtualMonitoring.h:111
 TVirtualMonitoring.h:112
 TVirtualMonitoring.h:113
 TVirtualMonitoring.h:114
 TVirtualMonitoring.h:115
 TVirtualMonitoring.h:116
 TVirtualMonitoring.h:117
 TVirtualMonitoring.h:118
 TVirtualMonitoring.h:119
 TVirtualMonitoring.h:120
 TVirtualMonitoring.h:121