00001 // $Id: DbFileHandler.h,v 1.5 2011/03/07 15:31:31 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 00050 00051 private: 00052 00053 void openFile(std::ofstream&, const utils::TimePoint_t&) const; 00054 00055 void addReportHeader(std::ostream&, const utils::TimePoint_t&) const; 00056 00057 //Prevent copying of the DbFileHandler 00058 DbFileHandler(DbFileHandler const&); 00059 DbFileHandler& operator=(DbFileHandler const&); 00060 00061 DiskWritingParams dwParams_; 00062 unsigned int runNumber_; 00063 }; 00064 00065 typedef boost::shared_ptr<DbFileHandler> DbFileHandlerPtr; 00066 00067 } // stor namespace 00068 00069 #endif // EventFilter_StorageManager_DbFileHandler_h 00070 00071