CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/EventFilter/StorageManager/interface/MonitorCollection.h

Go to the documentation of this file.
00001 // $Id: MonitorCollection.h,v 1.6 2011/03/07 15:31:32 mommsen Exp $
00003 
00004 #ifndef EventFilter_StorageManager_MonitorCollection_h
00005 #define EventFilter_StorageManager_MonitorCollection_h
00006 
00007 #include "xdata/Serializable.h"
00008 
00009 #include "EventFilter/StorageManager/interface/MonitoredQuantity.h"
00010 #include "EventFilter/StorageManager/interface/Utils.h"
00011 
00012 #include <string>
00013 
00014 
00015 namespace stor {
00016 
00025   class MonitorCollection
00026   {
00027   public:
00028 
00029     typedef std::vector< std::pair<std::string, xdata::Serializable*> > InfoSpaceItems;
00030 
00031 
00032     explicit MonitorCollection(const utils::Duration_t& updateInterval);
00033 
00034 
00035     // A pure virtual destructor results in a missing symbol
00036     virtual ~MonitorCollection() {};
00037 
00042     void appendInfoSpaceItems(InfoSpaceItems&);
00043 
00047     void calculateStatistics(const utils::TimePoint_t& now);
00048 
00055     void updateInfoSpaceItems();
00056 
00060     void reset(const utils::TimePoint_t& now);
00061 
00062     
00063   protected:
00064 
00065     virtual void do_calculateStatistics() = 0;
00066     virtual void do_reset() = 0;
00067     virtual void do_appendInfoSpaceItems(InfoSpaceItems&) {};
00068     virtual void do_updateInfoSpaceItems() {};
00069 
00070 
00071   private:
00072 
00073     //Prevent copying of the MonitorCollection
00074     MonitorCollection(MonitorCollection const&);
00075     MonitorCollection& operator=(MonitorCollection const&);
00076 
00077     const utils::Duration_t updateInterval_;
00078     utils::TimePoint_t lastCalculateStatistics_;
00079     bool infoSpaceUpdateNeeded_;
00080 
00081   };
00082   
00083 } // namespace stor
00084 
00085 #endif // EventFilter_StorageManager_MonitorCollection_h 
00086 
00087