CMS 3D CMS Logo

ESSourceDataProxyBase.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_ESSourceDataProxyBase_h
2 #define FWCore_Framework_ESSourceDataProxyBase_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : ESSourceDataProxyBase
7 //
21 //
22 // Original Author: Chris Jones
23 // Created: 14/05/2020
24 //
25 
26 // system include files
27 #include <mutex>
28 #include <atomic>
29 
30 // user include files
35 
36 // forward declarations
37 
38 namespace edm::eventsetup {
40  public:
42  : m_queue(iQueue), m_mutex(iMutex), m_prefetching{false} {}
43 
44  edm::SerialTaskQueue* queue() const { return m_queue; }
45  std::mutex* mutex() const { return m_mutex; }
46 
47  protected:
48  void invalidateCache() override {
50  m_prefetching = false;
51  }
52  void invalidateTransientCache() override {}
53 
54  virtual void prefetch(edm::eventsetup::DataKey const& iKey, EventSetupRecordDetails) = 0;
55 
56  private:
59  edm::eventsetup::DataKey const& iKey,
60  edm::EventSetupImpl const*,
61  edm::ServiceToken const&,
62  edm::ESParentContext const&) final;
63 
64  // ---------- member data --------------------------------
65 
69  std::atomic<bool> m_prefetching;
70  };
71 } // namespace edm::eventsetup
72 #endif
edm::eventsetup::ESSourceDataProxyBase::invalidateCache
void invalidateCache() override
Definition: ESSourceDataProxyBase.h:48
edm::EventSetupImpl
Definition: EventSetupImpl.h:49
edm::eventsetup::ESSourceDataProxyBase::m_mutex
std::mutex * m_mutex
Definition: ESSourceDataProxyBase.h:68
EventSetupRecordDetails.h
edm::eventsetup::DataKey
Definition: DataKey.h:29
edm::SerialTaskQueue
Definition: SerialTaskQueue.h:67
DataProxy.h
edm::WaitingTaskList::reset
void reset()
Resets access to the resource so that added tasks will wait.
Definition: WaitingTaskList.cc:53
edm::WaitingTaskList
Definition: WaitingTaskList.h:84
edm::eventsetup::ESSourceDataProxyBase::ESSourceDataProxyBase
ESSourceDataProxyBase(edm::SerialTaskQueue *iQueue, std::mutex *iMutex)
Definition: ESSourceDataProxyBase.h:41
edm::ServiceToken
Definition: ServiceToken.h:42
SerialTaskQueue.h
edm::eventsetup::ESSourceDataProxyBase::m_queue
edm::SerialTaskQueue * m_queue
Definition: ESSourceDataProxyBase.h:67
edm::eventsetup::ESSourceDataProxyBase
Definition: ESSourceDataProxyBase.h:39
edm::EventSetupRecordDetails
Definition: EventSetupRecordDetails.h:29
edm::eventsetup::EventSetupRecordImpl
Definition: EventSetupRecordImpl.h:77
edm::WaitingTaskHolder
Definition: WaitingTaskHolder.h:32
mutex
static std::mutex mutex
Definition: Proxy.cc:8
edm::ESParentContext
Definition: ESParentContext.h:21
edm::eventsetup::DataProxy
Definition: DataProxy.h:42
edm::eventsetup::ESSourceDataProxyBase::m_waitingList
edm::WaitingTaskList m_waitingList
Definition: ESSourceDataProxyBase.h:66
edm::eventsetup::ESSourceDataProxyBase::mutex
std::mutex * mutex() const
Definition: ESSourceDataProxyBase.h:45
edm::eventsetup::ESSourceDataProxyBase::prefetchAsyncImpl
void prefetchAsyncImpl(edm::WaitingTaskHolder iTask, edm::eventsetup::EventSetupRecordImpl const &, edm::eventsetup::DataKey const &iKey, edm::EventSetupImpl const *, edm::ServiceToken const &, edm::ESParentContext const &) final
Definition: ESSourceDataProxyBase.cc:25
edm::eventsetup::ESSourceDataProxyBase::prefetch
virtual void prefetch(edm::eventsetup::DataKey const &iKey, EventSetupRecordDetails)=0
edm::eventsetup::ESSourceDataProxyBase::queue
edm::SerialTaskQueue * queue() const
Definition: ESSourceDataProxyBase.h:44
WaitingTaskList.h
edm::eventsetup
Definition: ES_DDDetector.cc:16
edm::eventsetup::ESSourceDataProxyBase::m_prefetching
std::atomic< bool > m_prefetching
Definition: ESSourceDataProxyBase.h:69
edm::eventsetup::ESSourceDataProxyBase::invalidateTransientCache
void invalidateTransientCache() override
Definition: ESSourceDataProxyBase.h:52