CMS 3D CMS Logo

DelayedReader.cc
Go to the documentation of this file.
6 
7 #include <mutex>
8 #include <cassert>
9 /*----------------------------------------------------------------------
10 
11 
12 ----------------------------------------------------------------------*/
13 
14 namespace edm {
16 
17  std::unique_ptr<WrapperBase> DelayedReader::getProduct(BranchID const& k,
18  EDProductGetter const* ep,
19  ModuleCallingContext const* mcc) {
20  auto preSignal = preEventReadFromSourceSignal();
21  if (mcc and preSignal) {
22  preSignal->emit(*(mcc->getStreamContext()), *mcc);
23  }
24  auto postSignal = postEventReadFromSourceSignal();
25 
26  auto sentryCall = [&postSignal](ModuleCallingContext const* iContext) {
27  if (postSignal) {
28  postSignal->emit(*(iContext->getStreamContext()), *iContext);
29  }
30  };
31  std::unique_ptr<ModuleCallingContext const, decltype(sentryCall)> sentry(mcc, sentryCall);
32 
33  return getProduct_(k, ep);
34  }
35 
36  std::pair<SharedResourcesAcquirer*, std::recursive_mutex*> DelayedReader::sharedResources_() const {
37  return std::pair<SharedResourcesAcquirer*, std::recursive_mutex*>(nullptr, nullptr);
38  }
39 } // namespace edm
StreamContext const * getStreamContext() const
virtual ~DelayedReader()
std::unique_ptr< WrapperBase > getProduct(BranchID const &k, EDProductGetter const *ep, ModuleCallingContext const *mcc=nullptr)
virtual signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const * postEventReadFromSourceSignal() const =0
virtual signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const * preEventReadFromSourceSignal() const =0
int k[5][pyjets_maxn]
HLT enums.
virtual std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > sharedResources_() const
virtual std::unique_ptr< WrapperBase > getProduct_(BranchID const &k, EDProductGetter const *ep)=0