CMS 3D CMS Logo

KeyListProxy.h
Go to the documentation of this file.
1 #ifndef CondCore_CondDB_KeyListProxy_h
2 #define CondCore_CondDB_KeyListProxy_h
3 
6 #include <memory>
7 #include <vector>
8 #include <string>
9 
10 namespace cond {
11 
12  struct Iov_t;
13 
14  namespace persistency {
15 
16  class Session;
17 
18  template <>
19  class PayloadProxy<cond::persistency::KeyList> : public PayloadProxy<std::vector<cond::Time_t>> {
20  public:
21  typedef std::vector<cond::Time_t> DataT;
23 
24  explicit PayloadProxy(Iov_t const* mostRecentCurrentIov,
25  Session const* mostRecentSession,
26  std::shared_ptr<std::vector<Iov_t>> const* mostRecentRequests,
27  const char* source = nullptr)
28  : super(mostRecentCurrentIov, mostRecentSession, mostRecentRequests, source), m_keyList() {
29  if (source)
30  m_name = source;
31  }
32 
33  ~PayloadProxy() override {}
34 
35  void initKeyList(PayloadProxy const& originalPayloadProxy) { m_keyList.init(originalPayloadProxy.m_keyList); }
36 
37  // dereference (does not load)
38  const KeyList& operator()() const { return m_keyList; }
39 
40  void loadMore(CondGetter const& getter) override { m_keyList.init(getter.get(m_name)); }
41 
42  protected:
43  void loadPayload() override {
44  super::loadPayload();
45  m_keyList.setKeys(super::operator()());
46  }
47 
48  private:
51  };
52  } // namespace persistency
53 
54 } // namespace cond
55 #endif
PayloadProxy(Iov_t const *mostRecentCurrentIov, Session const *mostRecentSession, std::shared_ptr< std::vector< Iov_t >> const *mostRecentRequests, const char *source=nullptr)
Definition: KeyListProxy.h:24
virtual IOVProxy get(std::string name) const =0
void initKeyList(PayloadProxy const &originalPayloadProxy)
Definition: KeyListProxy.h:35
void loadMore(CondGetter const &getter) override
Definition: KeyListProxy.h:40
static std::string const source
Definition: EdmProvDump.cc:49