CMS 3D CMS Logo

DataProxyProvider.h
Go to the documentation of this file.
1 #ifndef Framework_DataProxyProvider_h
2 #define Framework_DataProxyProvider_h
3 // -*- C++ -*-
4 //
5 // Package: Framework
6 // Class : DataProxyProvider
7 //
16 //
17 // Author: Chris Jones
18 // Created: Mon Mar 28 14:21:58 EST 2005
19 //
20 
21 // system include files
22 #include <map>
23 #include <memory>
24 #include <set>
25 #include <string>
26 #include <vector>
27 
28 // user include files
33 
34 // forward declarations
35 namespace edm {
36  class ValidityInterval;
37  class ParameterSet;
39  namespace eventsetup {
40  class DataProxy;
41 
42 
44 {
45 
46  public:
47  typedef std::vector< EventSetupRecordKey> Keys;
48  typedef std::vector<std::pair<DataKey, edm::propagate_const<std::shared_ptr<DataProxy>>>> KeyedProxies;
49  typedef std::map<EventSetupRecordKey, KeyedProxies> RecordProxies;
50 
53 
54  // ---------- const member functions ---------------------
55  bool isUsingRecord(const EventSetupRecordKey&) const;
56 
57  std::set<EventSetupRecordKey> usingRecords() const;
58 
59  const KeyedProxies& keyedProxies(const EventSetupRecordKey& iRecordKey) const ;
60 
61  const ComponentDescription& description() const { return description_;}
62  // ---------- static member functions --------------------
66 
67  // ---------- member functions ---------------------------
68 
70  virtual void newInterval(const EventSetupRecordKey& iRecordType,
71  const ValidityInterval& iInterval) = 0;
72 
73  void setDescription(const ComponentDescription& iDescription) {
74  description_ = iDescription;
75  }
76 
81 
82  void resetProxies(const EventSetupRecordKey& iRecordType);
83  void resetProxiesIfTransient(const EventSetupRecordKey& iRecordType);
84 
85  protected:
86  template< class T>
87  void usingRecord() {
88  usingRecordWithKey(EventSetupRecordKey::makeKey<T>());
89  }
90 
92 
93  void invalidateProxies(const EventSetupRecordKey& iRecordKey) ;
94 
95  virtual void registerProxies(const EventSetupRecordKey& iRecordKey ,
96  KeyedProxies& aProxyList) = 0 ;
97 
99  void eraseAll(const EventSetupRecordKey& iRecordKey) ;
100 
101  private:
102  DataProxyProvider(const DataProxyProvider&); // stop default
103 
104  const DataProxyProvider& operator=(const DataProxyProvider&); // stop default
105 
106  // ---------- member data --------------------------------
107  RecordProxies recordProxies_;
110 };
111 
112 template<class ProxyT>
114  std::shared_ptr<ProxyT> iProxy,
115  const char* iName="") {
117  DataKey(DataKey::makeTypeTag<typename ProxyT::value_type>(),
118  iName),
119  iProxy));
120 
121 }
122 
123  }
124 }
125 #endif
void resetProxiesIfTransient(const EventSetupRecordKey &iRecordType)
virtual ~DataProxyProvider() noexcept(false)
const KeyedProxies & keyedProxies(const EventSetupRecordKey &iRecordKey) const
void setDescription(const ComponentDescription &iDescription)
std::vector< EventSetupRecordKey > Keys
bool isUsingRecord(const EventSetupRecordKey &) const
virtual void registerProxies(const EventSetupRecordKey &iRecordKey, KeyedProxies &aProxyList)=0
std::map< EventSetupRecordKey, KeyedProxies > RecordProxies
#define noexcept
void eraseAll(const EventSetupRecordKey &iRecordKey)
deletes all the Proxies in aStream
void usingRecordWithKey(const EventSetupRecordKey &)
std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
void invalidateProxies(const EventSetupRecordKey &iRecordKey)
static void prevalidate(ConfigurationDescriptions &)
void resetProxies(const EventSetupRecordKey &iRecordType)
const ComponentDescription & description() const
std::set< EventSetupRecordKey > usingRecords() const
virtual void newInterval(const EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)=0
called when a new interval of validity occurs for iRecordType
void setAppendToDataLabel(const edm::ParameterSet &)
void insertProxy(DataProxyProvider::KeyedProxies &iList, std::shared_ptr< ProxyT > iProxy, const char *iName="")
HLT enums.
const DataProxyProvider & operator=(const DataProxyProvider &)