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 Framework_EventSetupProvider_h
2 #define 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 // system include files
22 #include <memory>
23 #include <map>
24 #include <set>
25 #include <string>
26 #include <vector>
27 
28 #include "boost/shared_ptr.hpp"
29 
30 // user include files
32 
33 // forward declarations
34 namespace edm {
35  class IOVSyncValue;
37 
38  namespace eventsetup {
40  class DataProxyProvider;
42 
44 {
45 
46  public:
47  typedef std::string RecordName;
48  typedef std::string DataType;
49  typedef std::string DataLabel;
50  typedef std::pair<DataType,DataLabel> DataKeyInfo;
51  typedef std::multimap<RecordName,DataKeyInfo> RecordToDataMap;
52  typedef std::map<ComponentDescription,RecordToDataMap > PreferredProviderInfo;
54  virtual ~EventSetupProvider();
55 
56  // ---------- const member functions ---------------------
57  std::set<ComponentDescription> proxyProviderDescriptions() const;
58 
59  // ---------- static member functions --------------------
60 
61  // ---------- member functions ---------------------------
63 
64  EventSetup const& eventSetup() const {return eventSetup_;}
65 
66  //called by specializations of EventSetupRecordProviders
67  template<class T>
68  void addRecordToEventSetup(T& iRecord) {
69  iRecord.setEventSetup(&eventSetup_);
70  eventSetup_.add(iRecord);
71  }
72 
73  void add(boost::shared_ptr<DataProxyProvider>);
74  void add(boost::shared_ptr<EventSetupRecordIntervalFinder>);
75 
76  void finishConfiguration();
77 
80 
82  void forceCacheClear();
83 
84  protected:
85 
86  template <class T>
87  void insert(std::auto_ptr<T> iRecordProvider) {
88  std::auto_ptr<EventSetupRecordProvider> temp(iRecordProvider.release());
90  typename T::RecordType,
92  temp);
93  }
94 
95  private:
96  EventSetupProvider(const EventSetupProvider&); // stop default
97 
98  const EventSetupProvider& operator=(const EventSetupProvider&); // stop default
99 
100 
101  void insert(const EventSetupRecordKey&, std::auto_ptr<EventSetupRecordProvider>);
102 
103  // ---------- member data --------------------------------
105  typedef std::map<EventSetupRecordKey, boost::shared_ptr<EventSetupRecordProvider> > Providers;
108 
109  std::auto_ptr<PreferredProviderInfo> preferredProviderInfo_;
110  std::auto_ptr<std::vector<boost::shared_ptr<EventSetupRecordIntervalFinder> > > finders_;
111  std::auto_ptr<std::vector<boost::shared_ptr<DataProxyProvider> > > dataProviders_;
112 };
113 
114  }
115 }
116 #endif
EventSetupProvider(const PreferredProviderInfo *iInfo=0)
std::auto_ptr< PreferredProviderInfo > preferredProviderInfo_
void resetRecordPlusDependentRecords(const EventSetupRecordKey &)
Used when we need to force a Record to reset all its proxies.
std::pair< DataType, DataLabel > DataKeyInfo
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.
EventSetup const & eventSetupForInstance(const IOVSyncValue &)
const EventSetupProvider & operator=(const EventSetupProvider &)
void insert(std::auto_ptr< T > iRecordProvider)
std::auto_ptr< std::vector< boost::shared_ptr< DataProxyProvider > > > dataProviders_
void add(boost::shared_ptr< DataProxyProvider >)
void add(const T &iRecord)
Definition: EventSetup.h:109
EventSetup const & eventSetup() const
std::map< EventSetupRecordKey, boost::shared_ptr< EventSetupRecordProvider > > Providers
std::map< ComponentDescription, RecordToDataMap > PreferredProviderInfo
std::multimap< RecordName, DataKeyInfo > RecordToDataMap
std::set< ComponentDescription > proxyProviderDescriptions() const