CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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,
71  std::shared_ptr<ProxyFactoryBase> iFactory)
72  : key_(iKey),
73  factory_(iFactory) {}
76  };
77  }
78 
80 {
81 
82  public:
84  virtual ~ESProxyFactoryProducer() noexcept(false);
85 
86  // ---------- const member functions ---------------------
87 
88  // ---------- static member functions --------------------
89 
90  // ---------- member functions ---------------------------
92  virtual void newInterval(const eventsetup::EventSetupRecordKey& iRecordType,
93  const ValidityInterval& iInterval) ;
94 
95  protected:
97  virtual void registerProxies(const eventsetup::EventSetupRecordKey& iRecord ,
98  KeyedProxies& aProxyList) ;
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());
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&); // stop default
122 
123  const ESProxyFactoryProducer& operator=(const ESProxyFactoryProducer&); // stop default
124 
125 
126  // ---------- member data --------------------------------
127  std::multimap< eventsetup::EventSetupRecordKey, eventsetup::FactoryInfo > record2Factories_;
128 
129 };
130 
131 }
132 
133 #endif
virtual void registerProxies(const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
override DataProxyProvider method
virtual ~ESProxyFactoryProducer() noexcept(false)
#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)
virtual void newInterval(const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
overrides DataProxyProvider method
def move
Definition: eostools.py:510
const ESProxyFactoryProducer & operator=(const ESProxyFactoryProducer &)
virtual void registerFactoryWithKey(const eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
void registerFactory(std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())