Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:09

0001 #ifndef FWCore_Framework_EventAcquireSignalsSentry_h
0002 #define FWCore_Framework_EventAcquireSignalsSentry_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     FWCore/Framework
0006 // Class  :     EventAcquireSignalsSentry
0007 //
0008 /**\class edm::EventAcquireSignalsSentry EventAcquireSignalsSentry.h "EventAcquireSignalsSentry.h"
0009 
0010  Description: Guarantees that the pre/post module EventAcquire signals are sent
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  W. David Dagenhart
0018 //         Created:  Mon, 20 October 2017
0019 //
0020 
0021 // system include files
0022 #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
0023 #include "FWCore/ServiceRegistry/interface/ModuleCallingContext.h"
0024 
0025 // user include files
0026 
0027 // forward declarations
0028 namespace edm {
0029   class EventAcquireSignalsSentry {
0030   public:
0031     EventAcquireSignalsSentry(ActivityRegistry* iReg, ModuleCallingContext const* iContext)
0032         : m_reg(iReg), m_context(iContext) {
0033       iReg->preModuleEventAcquireSignal_(*(iContext->getStreamContext()), *iContext);
0034     }
0035 
0036     ~EventAcquireSignalsSentry() { m_reg->postModuleEventAcquireSignal_(*(m_context->getStreamContext()), *m_context); }
0037 
0038   private:
0039     // ---------- member data --------------------------------
0040     ActivityRegistry* m_reg;  // We do not use propagate_const because the registry itself is mutable.
0041     ModuleCallingContext const* m_context;
0042   };
0043 }  // namespace edm
0044 
0045 #endif