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,
71  std::shared_ptr<ProxyFactoryBase> iFactory)
72  : key_(iKey),
73  factory_(iFactory) {}
76  };
77  }
78 
80 {
81 
82  public:
84  ~ESProxyFactoryProducer() noexcept(false) override;
85 
86  // ---------- const member functions ---------------------
87 
88  // ---------- static member functions --------------------
89 
90  // ---------- member functions ---------------------------
92  void newInterval(const eventsetup::EventSetupRecordKey& iRecordType,
93  const ValidityInterval& iInterval) override ;
94 
95  protected:
97  void registerProxies(const eventsetup::EventSetupRecordKey& iRecord ,
98  KeyedProxies& aProxyList) override ;
99 
106  template< class TFactory>
107  void registerFactory(std::unique_ptr<TFactory> iFactory,
108  const std::string& iLabel = std::string()) {
109  std::unique_ptr<eventsetup::ProxyFactoryBase> temp(iFactory.release());
110  registerFactoryWithKey(
111  eventsetup::EventSetupRecordKey::makeKey<typename TFactory::record_type>(),
112  std::move(temp),
113  iLabel);
114  }
115 
116  virtual void registerFactoryWithKey(const eventsetup::EventSetupRecordKey& iRecord ,
117  std::unique_ptr<eventsetup::ProxyFactoryBase> iFactory,
118  const std::string& iLabel= std::string() );
119 
120  private:
121  ESProxyFactoryProducer(const ESProxyFactoryProducer&) = delete; // stop default
122 
123  const ESProxyFactoryProducer& operator=(const ESProxyFactoryProducer&) = delete; // stop default
124 
125 
126  // ---------- member data --------------------------------
127  std::multimap< eventsetup::EventSetupRecordKey, eventsetup::FactoryInfo > record2Factories_;
128 
129 };
130 
131 }
132 
133 #endif
#define noexcept
std::multimap< eventsetup::EventSetupRecordKey, eventsetup::FactoryInfo > record2Factories_
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)
void registerFactory(std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
HLT enums.
def move(src, dest)
Definition: eostools.py:510