00001 // $Id: TDbiTimerManager.hxx,v 1.1 2011/01/18 05:49:20 finch Exp $ 00002 00003 #ifndef DBITIMERMANAGER 00004 #define DBITIMERMANAGER 00005 00006 //////////////////////////////////////////////////////////////////////// 00007 /// \class TDbiTimerManager 00008 /// 00009 /// \brief <b> Concept: </b>Manager of a set of simple timers. 00010 /// 00011 /// <b> Purpose: </b> To find out why this is all soooo sssllloooowwww! 00012 /// 00013 //////////////////////////////////////////////////////////////////////// 00014 00015 #include <string> 00016 #include <list> 00017 00018 using std::string; 00019 using std::list; 00020 00021 class TDbiTableMetaData; 00022 class TDbiTimer; 00023 00024 class TDbiTimerManager 00025 { 00026 00027 public: 00028 00029 // Constructors and destructors. 00030 TDbiTimerManager(); 00031 virtual ~TDbiTimerManager(); 00032 00033 // State testing member functions 00034 00035 // State changing member functions 00036 void Enable(Bool_t flag=kTRUE, 00037 Bool_t enableSubWatch = kFALSE) { fEnabled = flag; 00038 fSubWatchEnabled = enableSubWatch;} 00039 void RecBegin(string tableName, UInt_t rowSize); 00040 void RecEnd(UInt_t numRows); 00041 void RecFillAgg(Int_t aggNo); 00042 void RecMainQuery(); 00043 void StartSubWatch(UInt_t subWatch); 00044 00045 // Global timer manager used for all queries to the DBI. 00046 00047 static TDbiTimerManager gTimerManager; 00048 00049 private: 00050 00051 TDbiTimer* GetCurrent(); 00052 TDbiTimer* Pop(); 00053 TDbiTimer* Push(); 00054 00055 // Data members 00056 00057 Bool_t fEnabled; // Enable/disable 00058 Bool_t fSubWatchEnabled; 00059 // SubWatch Enable/disable (not used now). 00060 list<TDbiTimer*> fTimers; // Push-down stack of timers. 00061 00062 ClassDef(TDbiTimerManager,0) // Simple query timer 00063 00064 }; 00065 00066 00067 00068 #endif // DBITIMERMANAGER 00069 00070