CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 <set>
24 #include <string>
25 #include <vector>
26 #include "boost/shared_ptr.hpp"
27 
28 // user include files
32 
33 // forward declarations
34 namespace edm {
35  class ValidityInterval;
36  class ParameterSet;
38  namespace eventsetup {
39  class DataProxy;
40 
41 
43 {
44 
45  public:
46  typedef std::vector< EventSetupRecordKey> Keys;
47  typedef std::vector<std::pair<DataKey,
48  boost::shared_ptr<DataProxy> > > KeyedProxies ;
49  typedef std::map<EventSetupRecordKey, KeyedProxies> RecordProxies;
50 
52  virtual ~DataProxyProvider();
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 --------------------------------
109  std::string appendToDataLabel_;
110 };
111 
112 template<class ProxyT>
114  boost::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)
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
void eraseAll(const EventSetupRecordKey &iRecordKey)
deletes all the Proxies in aStream
void usingRecordWithKey(const EventSetupRecordKey &)
void invalidateProxies(const EventSetupRecordKey &iRecordKey)
static void prevalidate(ConfigurationDescriptions &)
std::vector< std::pair< DataKey, boost::shared_ptr< DataProxy > > > KeyedProxies
void insertProxy(DataProxyProvider::KeyedProxies &iList, boost::shared_ptr< ProxyT > iProxy, const char *iName="")
void resetProxies(const EventSetupRecordKey &iRecordType)
const ComponentDescription & description() const
Container::value_type value_type
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 &)
const DataProxyProvider & operator=(const DataProxyProvider &)