Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:21:17

0001 #ifndef IOPool_Output_TimeoutPoolOutputModule_h
0002 #define IOPool_Output_TimeoutPoolOutputModule_h
0003 
0004 //////////////////////////////////////////////////////////////////////
0005 //
0006 // Class TimeoutPoolOutputModule. Output module to POOL file with file
0007 // closure based on timeout. First file has only one event, second
0008 // file is closed after 15 seconds if at least one event was processed.
0009 // Then timeout is increased to 30 seconds and 60 seconds. After that
0010 // all other files are closed with timeout of 60 seconds.
0011 //
0012 // Created by Dmytro.Kovalskyi@cern.ch
0013 //
0014 //////////////////////////////////////////////////////////////////////
0015 
0016 #include "IOPool/Output/interface/PoolOutputModule.h"
0017 
0018 namespace edm {
0019   class ConfigurationDescriptions;
0020   class ModuleCallingContext;
0021   class ParameterSet;
0022 
0023   class TimeoutPoolOutputModule : public PoolOutputModule {
0024   public:
0025     explicit TimeoutPoolOutputModule(ParameterSet const& ps);
0026     ~TimeoutPoolOutputModule() override{};
0027     TimeoutPoolOutputModule(TimeoutPoolOutputModule const&) = delete;             // Disallow copying and moving
0028     TimeoutPoolOutputModule& operator=(TimeoutPoolOutputModule const&) = delete;  // Disallow copying and moving
0029 
0030     static void fillDescriptions(ConfigurationDescriptions& descriptions);
0031 
0032   protected:
0033     bool shouldWeCloseFile() const override;
0034     void write(EventForOutput const& e) override;
0035 
0036   private:
0037     mutable time_t m_lastEvent;
0038     mutable unsigned int eventsWrittenInCurrentFile;
0039     mutable int m_timeout;
0040   };
0041 }  // namespace edm
0042 
0043 #endif