Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TVirtualMonitoring.h
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Andreas-Joachim Peters 15/05/2006
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TVirtualMonitoring
13 #define ROOT_TVirtualMonitoring
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TVirtualMonitoring //
18 // //
19 // Provides the interface for Monitoring plugins. //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 #include "TNamed.h"
24 
25 #include "TList.h"
26 #include "TMap.h"
27 
28 class TFile;
29 
30 class TVirtualMonitoringWriter : public TNamed {
31 
32 private:
33 
34  TVirtualMonitoringWriter(const TVirtualMonitoringWriter&); // Not implemented
35  TVirtualMonitoringWriter& operator=(const TVirtualMonitoringWriter&); // Not implemented
36 
37  Double_t fValue; // double monitor value
38 
39 protected:
40  TList *fTmpOpenPhases; // To store open phases when there is not yet an object
41 
42 public:
43  TVirtualMonitoringWriter() : TNamed(), fValue(0), fTmpOpenPhases(0) { }
44  TVirtualMonitoringWriter(const char *name, Double_t value)
45  : TNamed(name, ""), fValue(value), fTmpOpenPhases(0) { }
46 
47  virtual ~TVirtualMonitoringWriter() { if (fTmpOpenPhases) delete fTmpOpenPhases; }
48 
49  // TFile related info. In general they are gathered and sent only sometimes as summaries
50  virtual Bool_t SendFileCloseEvent(TFile * /*file*/)
51  { MayNotUse("SendFileCloseEvent"); return kFALSE; }
52  virtual Bool_t SendFileReadProgress(TFile * /*file*/)
53  { MayNotUse("SendFileReadProgress"); return kFALSE; }
54  virtual Bool_t SendFileWriteProgress(TFile * /*file*/)
55  { MayNotUse("SendFileWriteProgress"); return kFALSE; }
56 
57  virtual Bool_t SendParameters(TList * /*valuelist*/, const char * /*identifier*/ = 0)
58  { MayNotUse("SendParameters"); return kFALSE; }
59  virtual Bool_t SendInfoTime() { MayNotUse("SendInfoTime"); return kFALSE; }
60  virtual Bool_t SendInfoUser(const char * /*user*/ = 0) { MayNotUse("SendInfoUser"); return kFALSE; }
61  virtual Bool_t SendInfoDescription(const char * /*jobtag*/) { MayNotUse("SendInfoDescription"); return kFALSE; }
62  virtual Bool_t SendInfoStatus(const char * /*status*/) { MayNotUse("SendInfoStatus"); return kFALSE; }
63 
64  // An Open might have several phases, and the timings might be interesting
65  // to report
66  // The info is only gathered into openphasestime, and sent when forcesend=kTRUE
67  virtual Bool_t SendFileOpenProgress(TFile * /*file*/, TList * /*openphases*/,
68  const char * /*openphasename*/,
69  Bool_t /*forcesend*/ = kFALSE )
70  { MayNotUse("SendFileOpenProgress"); return kFALSE; }
71 
72  virtual Bool_t SendProcessingStatus(const char * /*status*/, Bool_t /*restarttimer*/ = kFALSE)
73  { MayNotUse("SendProcessingStatus"); return kFALSE; }
74  virtual Bool_t SendProcessingProgress(Double_t /*nevent*/, Double_t /*nbytes*/, Bool_t /*force*/ = kFALSE)
75  { MayNotUse("SendProcessingProgress"); return kFALSE; }
76  virtual void SetLogLevel(const char * /*loglevel*/ = "WARNING")
77  { MayNotUse("SetLogLevel"); };
78  virtual void Verbose(Bool_t /*onoff*/) { MayNotUse("Verbose"); }
79 
80  ClassDef(TVirtualMonitoringWriter,0) // ABC for Sending Monitoring Information
81 };
82 
83 
84 class TVirtualMonitoringReader : public TNamed {
85 
86 public:
87  TVirtualMonitoringReader( const char * /*serviceurl*/ ="") { }
88  virtual ~TVirtualMonitoringReader() { }
89 
90  virtual void DumpResult() { MayNotUse("DumpResult"); }
91  virtual void GetValues(const char * /*farmName*/, const char * /*clusterName*/,
92  const char * /*nodeName*/, const char * /*paramName*/,
93  Long_t /*min*/, Long_t /*max*/, Bool_t /*debug*/ = kFALSE)
94  { MayNotUse("GetValues"); }
95  virtual void GetLastValues(const char * /*farmName*/, const char * /*clusterName*/,
96  const char * /*nodeName*/, const char * /*paramName*/,
97  Bool_t /*debug*/ =kFALSE)
98  { MayNotUse("GetLastValues"); }
99  virtual void ProxyValues(const char * /*farmName*/, const char * /*clusterName*/,
100  const char * /*nodeName*/, const char * /*paramName*/,
101  Long_t /*min*/, Long_t /*max*/, Long_t /*lifetime*/)
102  { MayNotUse("ProxyValues"); }
103 
104  virtual TMap *GetMap() { MayNotUse("GetMap"); return 0; }
105  virtual void DeleteMap(TMap * /*map*/) { MayNotUse("DeleteMap"); }
106 
107  ClassDef(TVirtualMonitoringReader, 1) // ABC for Reading Monitoring Information
108 };
109 
110 
111 R__EXTERN TVirtualMonitoringWriter *gMonitoringWriter;
112 R__EXTERN TVirtualMonitoringReader *gMonitoringReader;
113 
114 
115 #endif