File indexing completed on 2023-03-17 11:02:45
0001 #ifndef FWCore_Framework_ProxyFactoryTemplate_h
0002 #define FWCore_Framework_ProxyFactoryTemplate_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include <memory>
0023 #include <string>
0024
0025
0026 #include "FWCore/Framework/interface/ProxyFactoryBase.h"
0027 #include "FWCore/Framework/interface/DataKey.h"
0028
0029 namespace edm {
0030 namespace eventsetup {
0031
0032 class DataProxy;
0033
0034 template <class T>
0035 class ProxyFactoryTemplate : public ProxyFactoryBase {
0036 public:
0037 using RecordType = typename T::record_type;
0038
0039 ProxyFactoryTemplate() = default;
0040
0041 ProxyFactoryTemplate(const ProxyFactoryTemplate&) = delete;
0042 const ProxyFactoryTemplate& operator=(const ProxyFactoryTemplate&) = delete;
0043
0044 std::unique_ptr<DataProxy> makeProxy(unsigned int) override { return std::make_unique<T>(); }
0045
0046 DataKey makeKey(const std::string& iName) const override {
0047 return DataKey(DataKey::makeTypeTag<typename T::value_type>(), iName.c_str());
0048 }
0049 };
0050 }
0051 }
0052 #endif