CMS 3D CMS Logo

ESProxyFactoryProducer.h
Go to the documentation of this file.
1 #ifndef Framework_ESProxyFactoryProducer_h
2 #define Framework_ESProxyFactoryProducer_h
3 // -*- C++ -*-
4 //
5 // Package: Framework
6 // Class : ESProxyFactoryProducer
7 //
48 //
49 // Author: Chris Jones
50 // Created: Thu Apr 7 17:14:58 CDT 2005
51 //
52 
53 // system include files
54 #include <map>
55 #include <memory>
56 #include <string>
57 
58 // user include files
59 
60 // forward declarations
63 
64 namespace edm {
65  namespace eventsetup {
66  class ProxyFactoryBase;
67 
68  struct FactoryInfo {
70  FactoryInfo(const DataKey& iKey, std::shared_ptr<ProxyFactoryBase> iFactory) : key_(iKey), factory_(iFactory) {}
73  };
74  } // namespace eventsetup
75 
77  public:
79  ~ESProxyFactoryProducer() noexcept(false) override;
80 
81  // ---------- const member functions ---------------------
82 
83  // ---------- static member functions --------------------
84 
85  // ---------- member functions ---------------------------
87  void newInterval(const eventsetup::EventSetupRecordKey& iRecordType, const ValidityInterval& iInterval) override;
88 
89  protected:
91  void registerProxies(const eventsetup::EventSetupRecordKey& iRecord, KeyedProxies& aProxyList) override;
92 
99  template <class TFactory>
100  void registerFactory(std::unique_ptr<TFactory> iFactory, const std::string& iLabel = std::string()) {
101  std::unique_ptr<eventsetup::ProxyFactoryBase> temp(iFactory.release());
102  registerFactoryWithKey(
103  eventsetup::EventSetupRecordKey::makeKey<typename TFactory::record_type>(), std::move(temp), iLabel);
104  }
105 
106  virtual void registerFactoryWithKey(const eventsetup::EventSetupRecordKey& iRecord,
107  std::unique_ptr<eventsetup::ProxyFactoryBase> iFactory,
108  const std::string& iLabel = std::string());
109 
110  private:
111  ESProxyFactoryProducer(const ESProxyFactoryProducer&) = delete; // stop default
112 
113  const ESProxyFactoryProducer& operator=(const ESProxyFactoryProducer&) = delete; // stop default
114 
115  // ---------- member data --------------------------------
116  std::multimap<eventsetup::EventSetupRecordKey, eventsetup::FactoryInfo> record2Factories_;
117  };
118 
119 } // namespace edm
120 
121 #endif
edm::propagate_const< std::shared_ptr< ProxyFactoryBase > > factory_
std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
FactoryInfo(const DataKey &iKey, std::shared_ptr< ProxyFactoryBase > iFactory)
#define noexcept
void registerFactory(std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
HLT enums.
std::multimap< eventsetup::EventSetupRecordKey, eventsetup::FactoryInfo > record2Factories_
def move(src, dest)
Definition: eostools.py:511