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 
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
edm::eventsetup::DataProxyProvider
Definition: DataProxyProvider.h:64
edm::ESProxyFactoryProducer
Definition: ESProxyFactoryProducer.h:76
edm::eventsetup::FactoryInfo::key_
DataKey key_
Definition: ESProxyFactoryProducer.h:71
propagate_const.h
edm
HLT enums.
Definition: AlignableModifier.h:19
EventSetupRecordKey
edm::eventsetup::DataKey
Definition: DataKey.h:29
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::eventsetup::FactoryInfo::factory_
edm::propagate_const< std::shared_ptr< ProxyFactoryBase > > factory_
Definition: ESProxyFactoryProducer.h:72
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
edm::ESProxyFactoryProducer::record2Factories_
std::multimap< EventSetupRecordKey, eventsetup::FactoryInfo > record2Factories_
Definition: ESProxyFactoryProducer.h:108
edm::ESProxyFactoryProducer::ESProxyFactoryProducer
ESProxyFactoryProducer()
Definition: ESProxyFactoryProducer.cc:30
edm::propagate_const
Definition: propagate_const.h:32
DataProxyProvider.h
edm::ESProxyFactoryProducer::registerFactoryWithKey
virtual void registerFactoryWithKey(const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
Definition: ESProxyFactoryProducer.cc:48
edm::ESProxyFactoryProducer::registerFactory
void registerFactory(std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
Definition: ESProxyFactoryProducer.h:97
edm::eventsetup::FactoryInfo::FactoryInfo
FactoryInfo(const DataKey &iKey, std::shared_ptr< ProxyFactoryBase > iFactory)
Definition: ESProxyFactoryProducer.h:70
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ESProxyFactoryProducer::registerProxies
KeyedProxiesVector registerProxies(const EventSetupRecordKey &, unsigned int iovIndex) override
Definition: ESProxyFactoryProducer.cc:34
edm::eventsetup::DataProxyProvider::KeyedProxiesVector
std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >> KeyedProxiesVector
Definition: DataProxyProvider.h:196
edm::eventsetup::FactoryInfo::FactoryInfo
FactoryInfo()
Definition: ESProxyFactoryProducer.h:69
edm::ESProxyFactoryProducer::~ESProxyFactoryProducer
~ESProxyFactoryProducer() noexcept(false) override
Definition: ESProxyFactoryProducer.cc:32
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ESProxyFactoryProducer::operator=
const ESProxyFactoryProducer & operator=(const ESProxyFactoryProducer &)=delete
edm::eventsetup::FactoryInfo
Definition: ESProxyFactoryProducer.h:68