CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/IOPool/Output/interface/TimeoutPoolOutputModule.h

Go to the documentation of this file.
00001 #ifndef IOPool_Output_TimeoutPoolOutputModule_h
00002 #define IOPool_Output_TimeoutPoolOutputModule_h
00003 
00005 //
00006 // Class TimeoutPoolOutputModule. Output module to POOL file with file 
00007 // closure based on timeout. First file has only one event, second
00008 // file is closed after 15 seconds if at least one event was processed.
00009 // Then timeout is increased to 30 seconds and 60 seconds. After that
00010 // all other files are closed with timeout of 60 seconds.
00011 //
00012 // Created by Dmytro.Kovalskyi@cern.ch
00013 //
00015 
00016 #include "IOPool/Output/interface/PoolOutputModule.h"
00017 
00018 namespace edm {
00019   class ParameterSet;
00020 
00021   class TimeoutPoolOutputModule : public PoolOutputModule {
00022   public:
00023     explicit TimeoutPoolOutputModule(ParameterSet const& ps);
00024     virtual ~TimeoutPoolOutputModule(){};
00025   protected:
00026     virtual bool shouldWeCloseFile() const;
00027     virtual void write(EventPrincipal const& e);
00028 
00029   private:
00030     mutable time_t m_lastEvent;
00031     mutable unsigned int eventsWrittenInCurrentFile;
00032     mutable int    m_timeout;
00033   };
00034 }
00035 
00036 #endif