CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PayloadProxy.cc
Go to the documentation of this file.
2 
3 namespace cond {
4 
5  namespace persistency {
6 
8  m_iovProxy(),m_session() {
9  }
10 
12 
13  void BasePayloadProxy::setUp( Session dbSession ){
14  m_session = dbSession;
15  invalidateCache();
16  }
17 
19  m_session.transaction().start(true);
20  m_iovProxy = m_session.readIov( tag );
23  }
24 
25  void BasePayloadProxy::loadTag( const std::string& tag, const boost::posix_time::ptime& snapshotTime ){
26  m_session.transaction().start(true);
27  m_iovProxy = m_session.readIov( tag, snapshotTime );
30  }
31 
34  if( !tag.empty() ) loadTag( tag );
35  }
36 
38  if( !m_currentIov.isValidFor( time ) ){
40  m_session.transaction().start(true);
41  auto it = m_iovProxy.find( time );
42  if( it != m_iovProxy.end() ) {
43  m_currentIov = *it;
44  if(load) loadPayload();
45  }
47  }
49  }
50 
52  return m_currentIov.isValid();
53  }
54 
56  return m_iovProxy;
57  }
58 
59  }
60 }
virtual void clear()
Definition: Types.cc:10
std::string tag() const
Definition: IOVProxy.cc:187
void start(bool readOnly=true)
Definition: Session.cc:22
Time_t since
Definition: Types.h:56
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
Transaction & transaction()
Definition: Session.cc:66
IOVProxy readIov(const std::string &tag, bool full=false)
Definition: Session.cc:81
unsigned long long Time_t
Definition: Time.h:16
def load
Definition: svgfig.py:546
Iterator find(cond::Time_t time)
Definition: IOVProxy.cc:288
bool isValidFor(Time_t target) const
Definition: Types.cc:20
ValidityInterval setIntervalFor(Time_t target, bool loadPayload=false)
Definition: PayloadProxy.cc:37
void loadTag(const std::string &tag)
Definition: PayloadProxy.cc:18
void setUp(Session dbSession)
Definition: PayloadProxy.cc:13
bool isValid() const
Definition: Types.cc:16
Iterator end() const
Definition: IOVProxy.cc:265
Time_t till
Definition: Types.h:57