Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-22 01:53:28

0001 // -*- C++ -*-
0002 //
0003 // Package:     FWCore/Framework
0004 // Class  :     __class__
0005 //
0006 // Implementation:
0007 //     [Notes on implementation]
0008 //
0009 // Original Author:  __author__
0010 //         Created:  __date__
0011 //
0012 
0013 // system include files
0014 
0015 // user include files
0016 #include "FWCore/Framework/interface/ESSourceDataProxyBase.h"
0017 #include "FWCore/Framework/interface/DataKey.h"
0018 #include "FWCore/ServiceRegistry/interface/ESModuleCallingContext.h"
0019 #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
0020 
0021 //
0022 // member functions
0023 //
0024 
0025 bool edm::eventsetup::ESSourceDataProxyBase::needToPrefetch(edm::WaitingTaskHolder iTask) {
0026   m_waitingList.add(std::move(iTask));
0027   bool expected = false;
0028   return m_prefetching.compare_exchange_strong(expected, true);
0029 }
0030 
0031 void edm::eventsetup::ESSourceDataProxyBase::doPrefetchAndSignals(edm::eventsetup::EventSetupRecordImpl const& iRecord,
0032                                                                   edm::eventsetup::DataKey const& iKey,
0033                                                                   edm::ESParentContext const& iParent) {
0034   edm::ESModuleCallingContext context(providerDescription(), ESModuleCallingContext::State::kRunning, iParent);
0035   iRecord.activityRegistry()->preESModuleSignal_.emit(iRecord.key(), context);
0036   struct EndGuard {
0037     EndGuard(EventSetupRecordImpl const& iRecord, ESModuleCallingContext const& iContext)
0038         : record_{iRecord}, context_{iContext} {}
0039     ~EndGuard() { record_.activityRegistry()->postESModuleSignal_.emit(record_.key(), context_); }
0040     EventSetupRecordImpl const& record_;
0041     ESModuleCallingContext const& context_;
0042   } guardAR(iRecord, context);
0043   prefetch(iKey, EventSetupRecordDetails(&iRecord));
0044 }
0045 
0046 //
0047 // const member functions
0048 //
0049 
0050 //
0051 // static member functions
0052 //