Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-04-08 04:01:47

0001 #include "FWCore/Framework/interface/DelayedReader.h"
0002 #include "FWCore/Framework/interface/SharedResourcesAcquirer.h"
0003 #include "FWCore/ServiceRegistry/interface/ModuleCallingContext.h"
0004 #include "FWCore/ServiceRegistry/interface/StreamContext.h"
0005 #include "FWCore/Utilities/interface/Signal.h"
0006 
0007 #include <mutex>
0008 #include <cassert>
0009 /*----------------------------------------------------------------------
0010   
0011 
0012 ----------------------------------------------------------------------*/
0013 
0014 namespace edm {
0015   DelayedReader::~DelayedReader() {}
0016 
0017   std::shared_ptr<WrapperBase> DelayedReader::getProduct(BranchID const& k,
0018                                                          EDProductGetter const* ep,
0019                                                          ModuleCallingContext const* mcc) {
0020     auto preSignal = preEventReadFromSourceSignal();
0021     if (mcc and preSignal) {
0022       preSignal->emit(*(mcc->getStreamContext()), *mcc);
0023     }
0024     auto postSignal = postEventReadFromSourceSignal();
0025 
0026     auto sentryCall = [&postSignal](ModuleCallingContext const* iContext) {
0027       if (postSignal) {
0028         postSignal->emit(*(iContext->getStreamContext()), *iContext);
0029       }
0030     };
0031     std::unique_ptr<ModuleCallingContext const, decltype(sentryCall)> sentry(mcc, sentryCall);
0032 
0033     return getProduct_(k, ep);
0034   }
0035 
0036   std::pair<SharedResourcesAcquirer*, std::recursive_mutex*> DelayedReader::sharedResources_() const {
0037     return std::pair<SharedResourcesAcquirer*, std::recursive_mutex*>(nullptr, nullptr);
0038   }
0039 }  // namespace edm