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);
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
fwrapper::cs
unique_ptr< ClusterSequence > cs
Definition: fastjetfortran_madfks.cc:45
DataProxy.h
cond::DataProxyWrapperBase::addInfo
void addInfo(std::string const &il, std::string const &cs, std::string const &tag)
Definition: ProxyFactory.cc:23
loadRecoTauTagMVAsFromPrepDB_cfi.snapshotTime
snapshotTime
Definition: loadRecoTauTagMVAsFromPrepDB_cfi.py:10
ProxyFactory.h
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
EDM_REGISTER_PLUGINFACTORY
#define EDM_REGISTER_PLUGINFACTORY(_factory_, _category_)
Definition: PluginFactory.h:89
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cond::DataProxyWrapperBase::~DataProxyWrapperBase
virtual ~DataProxyWrapperBase()
Definition: ProxyFactory.cc:21
cond
Definition: plugin.cc:23
edmplugin::PluginFactory
Definition: PluginFactory.h:34
cond::pluginCategory
const char * pluginCategory()
Definition: ProxyFactory.cc:64
cond::Time_t
unsigned long long Time_t
Definition: Time.h:14
cond::DataProxyWrapperBase::DataProxyWrapperBase
DataProxyWrapperBase()
Definition: ProxyFactory.cc:19
cond::DataProxyWrapperBase::loadTag
void loadTag(std::string const &tag)
Definition: ProxyFactory.cc:29
cond::DataProxyWrapperBase::reload
void reload()
Definition: ProxyFactory.cc:45
cond::ValidityInterval
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
cond::DataProxyWrapperBase::setIntervalFor
ValidityInterval setIntervalFor(Time_t target, Time_t defaultIovSize)
Definition: ProxyFactory.cc:51
ntuplemaker.time
time
Definition: ntuplemaker.py:310