File indexing completed on 2024-05-11 03:34:18
0001 #ifndef FWCore_TestProcessor_TestESProductResolver_h
0002 #define FWCore_TestProcessor_TestESProductResolver_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include <memory>
0023
0024
0025 #include "FWCore/Framework/interface/ESProductResolver.h"
0026 #include "FWCore/Concurrency/interface/WaitingTaskHolder.h"
0027
0028
0029
0030 namespace edm {
0031 namespace test {
0032
0033 template <typename T>
0034 class TestESProductResolver : public eventsetup::ESProductResolver {
0035 public:
0036 TestESProductResolver() {}
0037
0038 void setData(std::unique_ptr<T> iData) { data_ = std::move(iData); }
0039
0040 void prefetchAsyncImpl(WaitingTaskHolder,
0041 eventsetup::EventSetupRecordImpl const&,
0042 eventsetup::DataKey const&,
0043 EventSetupImpl const*,
0044 ServiceToken const&,
0045 ESParentContext const&) noexcept final {
0046 return;
0047 }
0048
0049 void invalidateCache() final { data_.reset(); }
0050
0051 void const* getAfterPrefetchImpl() const final { return data_.get(); }
0052
0053 private:
0054 std::unique_ptr<T> data_;
0055 };
0056 }
0057
0058 }
0059
0060 #endif