CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
82 
83  ~ESProxyFactoryProducer() noexcept(false) override;
84 
85  protected:
87 
88  KeyedProxiesVector registerProxies(const EventSetupRecordKey&, unsigned int iovIndex) override;
89 
96  template <class TFactory>
97  void registerFactory(std::unique_ptr<TFactory> iFactory, const std::string& iLabel = std::string()) {
98  std::unique_ptr<eventsetup::ProxyFactoryBase> temp(iFactory.release());
99  registerFactoryWithKey(EventSetupRecordKey::makeKey<typename TFactory::RecordType>(), std::move(temp), iLabel);
100  }
101 
102  virtual void registerFactoryWithKey(const EventSetupRecordKey& iRecord,
103  std::unique_ptr<eventsetup::ProxyFactoryBase> iFactory,
104  const std::string& iLabel = std::string());
105 
106  private:
107  // ---------- member data --------------------------------
108  std::multimap<EventSetupRecordKey, eventsetup::FactoryInfo> record2Factories_;
109  };
110 
111 } // namespace edm
112 
113 #endif
const ESProxyFactoryProducer & operator=(const ESProxyFactoryProducer &)=delete
virtual void registerFactoryWithKey(const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
KeyedProxiesVector registerProxies(const EventSetupRecordKey &, unsigned int iovIndex) override
edm::propagate_const< std::shared_ptr< ProxyFactoryBase > > factory_
FactoryInfo(const DataKey &iKey, std::shared_ptr< ProxyFactoryBase > iFactory)
~ESProxyFactoryProducer() noexcept(false) override
def move
Definition: eostools.py:511
std::multimap< EventSetupRecordKey, eventsetup::FactoryInfo > record2Factories_
std::vector< std::pair< DataKey, std::shared_ptr< DataProxy >>> KeyedProxiesVector
void registerFactory(std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())