CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ProxyFactory.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: ESSources
4 // Class : ProxyFactory
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Sat Jul 23 19:14:11 EDT 2005
11 //
12 
13 // system include files
14 
15 // user include files
18 
20 
22 
24  m_label = il;
25  m_connString = cs;
26  m_tag = tag;
27 }
28 
30  m_session.transaction().start(true);
31  m_iovProxy = m_session.readIov(tag);
32  m_session.transaction().commit();
33  m_currentIov.clear();
34  m_requests = std::make_shared<std::vector<cond::Iov_t>>();
35 }
36 
37 void cond::DataProxyWrapperBase::loadTag(std::string const& tag, boost::posix_time::ptime const& snapshotTime) {
38  m_session.transaction().start(true);
39  m_iovProxy = m_session.readIov(tag, snapshotTime);
40  m_session.transaction().commit();
41  m_currentIov.clear();
42  m_requests = std::make_shared<std::vector<cond::Iov_t>>();
43 }
44 
46  std::string tag = m_iovProxy.tagInfo().name;
47  if (!tag.empty())
48  loadTag(tag);
49 }
50 
52  if (!m_currentIov.isValidFor(time)) {
53  m_currentIov.clear();
54  m_session.transaction().start(true);
55  m_currentIov = m_iovProxy.getInterval(time, defaultIovSize);
56  m_session.transaction().commit();
57  }
58  return cond::ValidityInterval(m_currentIov.since, m_currentIov.till);
59 }
60 
62 
63 namespace cond {
64  const char* pluginCategory() { return "CondProxyFactory"; }
65 } // namespace cond
void addInfo(std::string const &il, std::string const &cs, std::string const &tag)
Definition: ProxyFactory.cc:23
unique_ptr< ClusterSequence > cs
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
unsigned long long Time_t
Definition: Time.h:14
void loadTag(std::string const &tag)
Definition: ProxyFactory.cc:29
const char * pluginCategory()
Definition: ProxyFactory.cc:64
#define EDM_REGISTER_PLUGINFACTORY(_factory_, _category_)
Definition: PluginFactory.h:89
ValidityInterval setIntervalFor(Time_t target, Time_t defaultIovSize)
Definition: ProxyFactory.cc:51