CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EventSetupProvider.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_EventSetupProvider_h
2 #define FWCore_Framework_EventSetupProvider_h
3 // -*- C++ -*-
4 //
5 // Package: Framework
6 // Class: EventSetupProvider
7 //
16 //
17 // Author: Chris Jones
18 // Created: Thu Mar 24 14:10:07 EST 2005
19 //
20 
21 // user include files
23 
24 // system include files
25 #include "boost/shared_ptr.hpp"
26 
27 #include <memory>
28 #include <map>
29 #include <set>
30 #include <string>
31 #include <vector>
32 
33 
34 // forward declarations
35 namespace edm {
37  class IOVSyncValue;
38 
39  namespace eventsetup {
40  struct ComponentDescription;
41  class DataProxyProvider;
43  class EventSetupRecord;
44 
46 
47  public:
48  typedef std::string RecordName;
49  typedef std::string DataType;
50  typedef std::string DataLabel;
51  typedef std::pair<DataType, DataLabel> DataKeyInfo;
52  typedef std::multimap<RecordName, DataKeyInfo> RecordToDataMap;
53  typedef std::map<ComponentDescription, RecordToDataMap> PreferredProviderInfo;
54  EventSetupProvider(PreferredProviderInfo const* iInfo = 0);
55  virtual ~EventSetupProvider();
56 
57  // ---------- const member functions ---------------------
58  std::set<ComponentDescription> proxyProviderDescriptions() const;
59 
60  // ---------- static member functions --------------------
61 
62  // ---------- member functions ---------------------------
64 
65  EventSetup const& eventSetup() const {return eventSetup_;}
66 
67  //called by specializations of EventSetupRecordProviders
69 
70  void add(boost::shared_ptr<DataProxyProvider>);
71  void add(boost::shared_ptr<EventSetupRecordIntervalFinder>);
72 
73  void finishConfiguration();
74 
77 
79  void forceCacheClear();
80 
81  protected:
82 
83  template <typename T>
84  void insert(std::auto_ptr<T> iRecordProvider) {
85  std::auto_ptr<EventSetupRecordProvider> temp(iRecordProvider.release());
87  typename T::RecordType,
89  temp);
90  }
91 
92  private:
93  EventSetupProvider(EventSetupProvider const&); // stop default
94 
95  EventSetupProvider const& operator=(EventSetupProvider const&); // stop default
96 
97  void insert(EventSetupRecordKey const&, std::auto_ptr<EventSetupRecordProvider>);
98 
99  // ---------- member data --------------------------------
101  typedef std::map<EventSetupRecordKey, boost::shared_ptr<EventSetupRecordProvider> > Providers;
104 
105  std::auto_ptr<PreferredProviderInfo> preferredProviderInfo_;
106  std::auto_ptr<std::vector<boost::shared_ptr<EventSetupRecordIntervalFinder> > > finders_;
107  std::auto_ptr<std::vector<boost::shared_ptr<DataProxyProvider> > > dataProviders_;
108 };
109 
110  }
111 }
112 #endif
EventSetup const & eventSetupForInstance(IOVSyncValue const &)
std::auto_ptr< PreferredProviderInfo > preferredProviderInfo_
EventSetupProvider(PreferredProviderInfo const *iInfo=0)
EventSetupProvider const & operator=(EventSetupProvider const &)
std::auto_ptr< std::vector< boost::shared_ptr< EventSetupRecordIntervalFinder > > > finders_
void forceCacheClear()
Used when testing that all code properly updates on IOV changes of all Records.
std::multimap< RecordName, DataKeyInfo > RecordToDataMap
void resetRecordPlusDependentRecords(EventSetupRecordKey const &)
Used when we need to force a Record to reset all its proxies.
void insert(std::auto_ptr< T > iRecordProvider)
void addRecordToEventSetup(EventSetupRecord &iRecord)
std::auto_ptr< std::vector< boost::shared_ptr< DataProxyProvider > > > dataProviders_
std::map< ComponentDescription, RecordToDataMap > PreferredProviderInfo
void add(boost::shared_ptr< DataProxyProvider >)
EventSetup const & eventSetup() const
std::map< EventSetupRecordKey, boost::shared_ptr< EventSetupRecordProvider > > Providers
std::pair< DataType, DataLabel > DataKeyInfo
std::set< ComponentDescription > proxyProviderDescriptions() const