CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/EventFilter/StorageManager/interface/DbFileHandler.h

Go to the documentation of this file.
00001 // $Id: DbFileHandler.h,v 1.6 2012/04/04 12:16:26 mommsen Exp $
00003 
00004 #ifndef EventFilter_StorageManager_DbFileHandler_h
00005 #define EventFilter_StorageManager_DbFileHandler_h
00006 
00007 #include "EventFilter/StorageManager/interface/Configuration.h"
00008 
00009 #include "boost/shared_ptr.hpp"
00010 #include "boost/thread/mutex.hpp"
00011 
00012 #include <fstream>
00013 #include <string>
00014 
00015 
00016 namespace stor {
00017 
00026   class DbFileHandler
00027   {
00028   public:
00029         
00030     DbFileHandler();
00031     
00032     ~DbFileHandler() {};
00033 
00037     void configure(const unsigned int runNumber, const DiskWritingParams&);
00038 
00042     void writeOld(const utils::TimePoint_t&, const std::string&);
00043 
00048     void write(const std::string&);
00049 
00053     const DiskWritingParams& getDiskWritingParams() const
00054     { return dwParams_; }
00055 
00056 
00057   private:
00058     
00059     void openFile(std::ofstream&, const utils::TimePoint_t&) const;
00060 
00061     void addReportHeader(std::ostream&, const utils::TimePoint_t&) const;
00062 
00063     //Prevent copying of the DbFileHandler
00064     DbFileHandler(DbFileHandler const&);
00065     DbFileHandler& operator=(DbFileHandler const&);
00066     
00067     DiskWritingParams dwParams_;
00068     unsigned int runNumber_;
00069   };
00070 
00071   typedef boost::shared_ptr<DbFileHandler> DbFileHandlerPtr;
00072   
00073 } // stor namespace
00074 
00075 #endif // EventFilter_StorageManager_DbFileHandler_h
00076 
00077