CMS 3D CMS Logo

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);
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);
42  m_requests = std::make_shared<std::vector<cond::Iov_t>>();
43 }
44 
47  if (!tag.empty())
48  loadTag(tag);
49 }
50 
52  if (!m_currentIov.isValidFor(time)) {
54  m_session.transaction().start(true);
55  auto it = m_iovProxy.find(time);
56  if (it != m_iovProxy.end()) {
57  m_currentIov = *it;
58  }
60  }
62 }
63 
65 
66 namespace cond {
67  const char* pluginCategory() { return "CondProxyFactory"; }
68 } // namespace cond
virtual void clear()
Definition: Types.cc:10
persistency::IOVProxy m_iovProxy
Definition: DataProxy.h:115
std::string tag() const
Definition: IOVProxy.cc:218
#define EDM_REGISTER_PLUGINFACTORY(_factory_, _category_)
Definition: PluginFactory.h:89
void addInfo(std::string const &il, std::string const &cs, std::string const &tag)
Definition: ProxyFactory.cc:23
unique_ptr< ClusterSequence > cs
void start(bool readOnly=true)
Definition: Session.cc:18
ValidityInterval setIntervalFor(Time_t target)
Definition: ProxyFactory.cc:51
Time_t since
Definition: Types.h:53
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
Transaction & transaction()
Definition: Session.cc:43
IOVProxy readIov(const std::string &tag, bool full=false)
Definition: Session.cc:54
unsigned long long Time_t
Definition: Time.h:14
void loadTag(std::string const &tag)
Definition: ProxyFactory.cc:29
persistency::Session m_session
Definition: DataProxy.h:117
Iterator find(cond::Time_t time)
Definition: IOVProxy.cc:322
bool isValidFor(Time_t target) const
Definition: Types.cc:18
std::shared_ptr< std::vector< Iov_t > > m_requests
Definition: DataProxy.h:118
const char * pluginCategory()
Definition: ProxyFactory.cc:67
std::string const & tag() const
Definition: DataProxy.h:94
Definition: plugin.cc:23
Iterator end() const
Definition: IOVProxy.cc:293
Time_t till
Definition: Types.h:54