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 #include "boost/shared_ptr.hpp"
58 
59 // user include files
60 
61 // forward declarations
63 
64 namespace edm {
65  namespace eventsetup {
66  class ProxyFactoryBase;
67 
68  struct FactoryInfo {
70  FactoryInfo(const DataKey& iKey,
71  boost::shared_ptr<ProxyFactoryBase> iFactory)
72  : key_(iKey),
73  factory_(iFactory) {}
75  boost::shared_ptr<ProxyFactoryBase> factory_;
76  };
77  }
78 
80 {
81 
82  public:
84  virtual ~ESProxyFactoryProducer();
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::auto_ptr<TFactory> iFactory,
108  const std::string& iLabel = std::string()) {
109  std::auto_ptr<eventsetup::ProxyFactoryBase> temp(iFactory.release());
111  eventsetup::EventSetupRecordKey::makeKey<typename TFactory::record_type>(),
112  temp,
113  iLabel);
114  }
115 
116  virtual void registerFactoryWithKey(const eventsetup::EventSetupRecordKey& iRecord ,
117  std::auto_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
std::multimap< eventsetup::EventSetupRecordKey, eventsetup::FactoryInfo > record2Factories_
virtual void registerFactoryWithKey(const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
virtual void newInterval(const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
overrides DataProxyProvider method
std::vector< std::pair< DataKey, boost::shared_ptr< DataProxy > > > KeyedProxies
const ESProxyFactoryProducer & operator=(const ESProxyFactoryProducer &)
FactoryInfo(const DataKey &iKey, boost::shared_ptr< ProxyFactoryBase > iFactory)
boost::shared_ptr< ProxyFactoryBase > factory_
void registerFactory(std::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())