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
cond::persistency::PayloadProxy< cond::persistency::KeyList >::super
PayloadProxy< DataT > super
Definition: KeyListProxy.h:22
PayloadProxy.h
cond::persistency::PayloadProxy
Definition: PayloadProxy.h:61
cond::persistency::PayloadProxy< cond::persistency::KeyList >::initKeyList
void initKeyList(PayloadProxy const &originalPayloadProxy)
Definition: KeyListProxy.h:35
Utilities.operator
operator
Definition: Utilities.py:24
cond::persistency::PayloadProxy< cond::persistency::KeyList >::loadPayload
void loadPayload() override
Definition: KeyListProxy.h:43
cond::persistency::PayloadProxy< cond::persistency::KeyList >::m_keyList
KeyList m_keyList
Definition: KeyListProxy.h:50
Session
source
static const std::string source
Definition: EdmProvDump.cc:47
cond::persistency::PayloadProxy< cond::persistency::KeyList >::PayloadProxy
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
cond::persistency::CondGetter
Definition: PayloadProxy.h:20
cond
Definition: plugin.cc:23
cond::persistency::CondGetter::get
virtual IOVProxy get(std::string name) const =0
cond::persistency::Session
Definition: Session.h:63
cond::persistency::PayloadProxy< cond::persistency::KeyList >::m_name
std::string m_name
Definition: KeyListProxy.h:49
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cond::persistency::PayloadProxy< cond::persistency::KeyList >::DataT
std::vector< cond::Time_t > DataT
Definition: KeyListProxy.h:21
cond::persistency::PayloadProxy< cond::persistency::KeyList >::operator()
const KeyList & operator()() const
Definition: KeyListProxy.h:38
KeyList.h
cond::persistency::PayloadProxy< cond::persistency::KeyList >::loadMore
void loadMore(CondGetter const &getter) override
Definition: KeyListProxy.h:40
cond::persistency::KeyList
Definition: KeyList.h:33
cond::Iov_t
Definition: Types.h:47
cond::persistency::PayloadProxy< cond::persistency::KeyList >::~PayloadProxy
~PayloadProxy() override
Definition: KeyListProxy.h:33