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;
42 
44  public:
45  typedef std::vector<EventSetupRecordKey> Keys;
46  typedef std::vector<std::pair<DataKey, edm::propagate_const<std::shared_ptr<DataProxy>>>> KeyedProxies;
47  typedef std::map<EventSetupRecordKey, KeyedProxies> RecordProxies;
48 
51 
52  // ---------- const member functions ---------------------
53  bool isUsingRecord(const EventSetupRecordKey&) const;
54 
55  std::set<EventSetupRecordKey> usingRecords() const;
56 
57  const KeyedProxies& keyedProxies(const EventSetupRecordKey& iRecordKey) const;
58 
59  const ComponentDescription& description() const { return description_; }
60  // ---------- static member functions --------------------
64 
65  // ---------- member functions ---------------------------
66 
67  virtual void updateLookup(ESRecordsToProxyIndices const&);
68 
70  virtual void newInterval(const EventSetupRecordKey& iRecordType, const ValidityInterval& iInterval) = 0;
71 
72  void setDescription(const ComponentDescription& iDescription) { description_ = iDescription; }
73 
78 
79  void resetProxies(const EventSetupRecordKey& iRecordType);
80  void resetProxiesIfTransient(const EventSetupRecordKey& iRecordType);
81 
82  protected:
83  template <class T>
84  void usingRecord() {
85  usingRecordWithKey(EventSetupRecordKey::makeKey<T>());
86  }
87 
89 
90  void invalidateProxies(const EventSetupRecordKey& iRecordKey);
91 
92  virtual void registerProxies(const EventSetupRecordKey& iRecordKey, KeyedProxies& aProxyList) = 0;
93 
95  void eraseAll(const EventSetupRecordKey& iRecordKey);
96 
97  private:
98  DataProxyProvider(const DataProxyProvider&); // stop default
99 
100  const DataProxyProvider& operator=(const DataProxyProvider&); // stop default
101 
102  // ---------- member data --------------------------------
103  RecordProxies recordProxies_;
106  };
107 
108  template <class ProxyT>
110  std::shared_ptr<ProxyT> iProxy,
111  const char* iName = "") {
113  DataKey(DataKey::makeTypeTag<typename ProxyT::value_type>(), iName), iProxy));
114  }
115 
116  } // namespace eventsetup
117 } // namespace edm
118 #endif
void resetProxiesIfTransient(const EventSetupRecordKey &iRecordType)
std::vector< EventSetupRecordKey > Keys
virtual ~DataProxyProvider() noexcept(false)
const KeyedProxies & keyedProxies(const EventSetupRecordKey &iRecordKey) const
void setDescription(const ComponentDescription &iDescription)
bool isUsingRecord(const EventSetupRecordKey &) const
virtual void registerProxies(const EventSetupRecordKey &iRecordKey, KeyedProxies &aProxyList)=0
std::map< EventSetupRecordKey, KeyedProxies > RecordProxies
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)
virtual void updateLookup(ESRecordsToProxyIndices const &)
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
#define noexcept
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 &)