1 #ifndef CondCore_CondDB_PayloadProxy_h 2 #define CondCore_CondDB_PayloadProxy_h 15 namespace persistency {
31 Session const* mostRecentSession,
32 std::shared_ptr<std::vector<Iov_t>>
const* mostRecentRequests);
36 virtual void make() = 0;
42 void initializeForNewIOV();
45 virtual void loadPayload() = 0;
60 template <
typename DataT>
64 Session const* mostRecentSession,
65 std::shared_ptr<std::vector<Iov_t>>
const* mostRecentRequests,
66 const char*
source =
nullptr)
67 :
BasePayloadProxy(mostRecentCurrentIov, mostRecentSession, mostRecentRequests) {}
76 throwException(
"The Payload has not been loaded.",
"PayloadProxy::operator()");
83 if (m_iovAtInitialization.payloadId == m_currentPayloadId)
85 m_session.transaction().start(
true);
87 m_session.transaction().commit();
93 if (m_iovAtInitialization.payloadId.empty()) {
94 throwException(
"Can't load payload: no valid IOV found.",
"PayloadProxy::loadPayload");
96 m_data = m_session.fetchPayload<DataT>(m_iovAtInitialization.payloadId);
97 m_currentPayloadId = m_iovAtInitialization.payloadId;
98 m_requests->push_back(m_iovAtInitialization);
108 #endif // CondCore_CondDB_PayloadProxy_h
std::shared_ptr< std::vector< Iov_t > > m_requests
Iov_t const * m_mostRecentCurrentIov
S make(const edm::ParameterSet &cfg)
const DataT & operator()() const
Session const * m_mostRecentSession
void loadPayload() override
void initKeyList(PayloadProxy const &)
PayloadProxy(Iov_t const *mostRecentCurrentIov, Session const *mostRecentSession, std::shared_ptr< std::vector< Iov_t >> const *mostRecentRequests, const char *source=0)
Iov_t m_iovAtInitialization
std::shared_ptr< std::vector< Iov_t > > const * m_mostRecentRequests
std::unique_ptr< DataT > m_data
virtual void loadMore(CondGetter const &)
static std::string const source
void throwException(const std::string &message, const std::string &methodName)