CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
DataProxyWrapper< RecordT, DataT, Initializer > Class Template Reference

#include <DataProxy.h>

Inheritance diagram for DataProxyWrapper< RecordT, DataT, Initializer >:
cond::DataProxyWrapperBase

Public Types

typedef ::DataProxy< RecordT, DataT, Initializer > DataProxy
 
- Public Types inherited from cond::DataProxyWrapperBase
typedef std::pair< std::string, std::string > Args
 
typedef std::shared_ptr< edm::eventsetup::DataProxyedmProxyP
 
typedef std::shared_ptr< cond::persistency::BasePayloadProxyProxyP
 

Public Member Functions

 DataProxyWrapper (const char *source=nullptr)
 
edmProxyP edmProxy (unsigned int iovIndex) const override
 
void initConcurrentIOVs (unsigned int nConcurrentIOVs) override
 
void lateInit (cond::persistency::Session &iSession, const std::string &tag, const boost::posix_time::ptime &snapshotTime, std::string const &il, std::string const &cs) override
 
ProxyP proxy (unsigned int iovIndex) const override
 
edm::eventsetup::TypeTag type () const override
 
- Public Member Functions inherited from cond::DataProxyWrapperBase
void addInfo (std::string const &il, std::string const &cs, std::string const &tag)
 
std::string const & connString () const
 
Iov_t const & currentIov () const
 
 DataProxyWrapperBase ()
 
persistency::IOVProxyiovProxy ()
 
persistency::IOVProxy const & iovProxy () const
 
std::string const & label () const
 
void loadTag (std::string const &tag)
 
void loadTag (std::string const &tag, boost::posix_time::ptime const &snapshotTime)
 
void reload ()
 
std::shared_ptr< std::vector< Iov_t > > const & requests () const
 
persistency::Sessionsession ()
 
persistency::Session const & session () const
 
ValidityInterval setIntervalFor (Time_t target, Time_t defaultIovSize)
 
void setSession (persistency::Session const &v)
 
std::string const & tag () const
 
TimeType timeType () const
 
virtual ~DataProxyWrapperBase ()
 

Private Attributes

std::vector< edmProxyPm_edmProxies
 
std::vector< std::shared_ptr< cond::persistency::PayloadProxy< DataT > > > m_proxies
 
std::string m_source
 
edm::eventsetup::TypeTag m_type
 

Detailed Description

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
class DataProxyWrapper< RecordT, DataT, Initializer >

Definition at line 126 of file DataProxy.h.

Member Typedef Documentation

◆ DataProxy

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
typedef ::DataProxy<RecordT, DataT, Initializer> DataProxyWrapper< RecordT, DataT, Initializer >::DataProxy

Definition at line 128 of file DataProxy.h.

Constructor & Destructor Documentation

◆ DataProxyWrapper()

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
DataProxyWrapper< RecordT, DataT, Initializer >::DataProxyWrapper ( const char *  source = nullptr)
inlineexplicit

Definition at line 131 of file DataProxy.h.

131  : m_source(source ? source : "") {
132  //NOTE: We do this so that the type 'DataT' will get registered
133  // when the plugin is dynamically loaded
134  m_type = edm::eventsetup::DataKey::makeTypeTag<DataT>();
135  }

Member Function Documentation

◆ edmProxy()

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
edmProxyP DataProxyWrapper< RecordT, DataT, Initializer >::edmProxy ( unsigned int  iovIndex) const
inlineoverridevirtual

Implements cond::DataProxyWrapperBase.

Definition at line 174 of file DataProxy.h.

174 { return m_edmProxies.at(iovIndex); }

◆ initConcurrentIOVs()

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
void DataProxyWrapper< RecordT, DataT, Initializer >::initConcurrentIOVs ( unsigned int  nConcurrentIOVs)
inlineoverridevirtual

Implements cond::DataProxyWrapperBase.

Definition at line 154 of file DataProxy.h.

154  {
155  // Create additional PayloadProxy objects if we are allowing
156  // multiple IOVs to run concurrently.
157  if (m_proxies.size() != nConcurrentIOVs) {
158  assert(m_proxies.size() == 1);
159  for (unsigned int i = 1; i < nConcurrentIOVs; ++i) {
160  m_proxies.push_back(std::make_shared<cond::persistency::PayloadProxy<DataT>>(
161  &currentIov(), &session(), &requests(), m_source.empty() ? (const char*)nullptr : m_source.c_str()));
162  m_edmProxies.push_back(std::make_shared<DataProxy>(m_proxies[i]));
163  // This does nothing except in the special case of a KeyList PayloadProxy.
164  // They all need to have copies of the same IOVProxy object.
165  m_proxies[i]->initKeyList(*m_proxies[0]);
166  }
167  assert(m_proxies.size() == nConcurrentIOVs);
168  }
169  assert(m_proxies.size() == m_edmProxies.size());
170  }

◆ lateInit()

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
void DataProxyWrapper< RecordT, DataT, Initializer >::lateInit ( cond::persistency::Session iSession,
const std::string &  tag,
const boost::posix_time::ptime &  snapshotTime,
std::string const &  il,
std::string const &  cs 
)
inlineoverridevirtual

Implements cond::DataProxyWrapperBase.

Definition at line 138 of file DataProxy.h.

142  {
143  setSession(iSession);
144  // set the IOVProxy
146  // Only make the first PayloadProxy object now because we don't know yet
147  // how many we will need.
148  m_proxies.push_back(std::make_shared<cond::persistency::PayloadProxy<DataT>>(
149  &currentIov(), &session(), &requests(), m_source.empty() ? (const char*)nullptr : m_source.c_str()));
150  m_edmProxies.push_back(std::make_shared<DataProxy>(m_proxies[0]));
151  addInfo(il, cs, tag);
152  }

◆ proxy()

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
ProxyP DataProxyWrapper< RecordT, DataT, Initializer >::proxy ( unsigned int  iovIndex) const
inlineoverridevirtual

Implements cond::DataProxyWrapperBase.

Definition at line 173 of file DataProxy.h.

173 { return m_proxies.at(iovIndex); }

◆ type()

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
edm::eventsetup::TypeTag DataProxyWrapper< RecordT, DataT, Initializer >::type ( ) const
inlineoverridevirtual

Implements cond::DataProxyWrapperBase.

Definition at line 172 of file DataProxy.h.

172 { return m_type; }

Member Data Documentation

◆ m_edmProxies

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
std::vector<edmProxyP> DataProxyWrapper< RecordT, DataT, Initializer >::m_edmProxies
private

◆ m_proxies

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
std::vector<std::shared_ptr<cond::persistency::PayloadProxy<DataT> > > DataProxyWrapper< RecordT, DataT, Initializer >::m_proxies
private

◆ m_source

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
std::string DataProxyWrapper< RecordT, DataT, Initializer >::m_source
private

◆ m_type

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
edm::eventsetup::TypeTag DataProxyWrapper< RecordT, DataT, Initializer >::m_type
private
mps_fire.i
i
Definition: mps_fire.py:355
cond::persistency::PayloadProxy
Definition: PayloadProxy.h:61
fwrapper::cs
unique_ptr< ClusterSequence > cs
Definition: fastjetfortran_madfks.cc:45
cond::DataProxyWrapperBase::addInfo
void addInfo(std::string const &il, std::string const &cs, std::string const &tag)
Definition: ProxyFactory.cc:23
cond::DataProxyWrapperBase::setSession
void setSession(persistency::Session const &v)
Definition: DataProxy.h:102
loadRecoTauTagMVAsFromPrepDB_cfi.snapshotTime
snapshotTime
Definition: loadRecoTauTagMVAsFromPrepDB_cfi.py:10
DataProxyWrapper::m_type
edm::eventsetup::TypeTag m_type
Definition: DataProxy.h:178
cms::cuda::assert
assert(be >=bs)
source
static const std::string source
Definition: EdmProvDump.cc:47
cond::DataProxyWrapperBase::session
persistency::Session & session()
Definition: DataProxy.h:98
cond::DataProxyWrapperBase::currentIov
Iov_t const & currentIov() const
Definition: DataProxy.h:97
DataProxyWrapper::m_source
std::string m_source
Definition: DataProxy.h:177
cond::DataProxyWrapperBase::loadTag
void loadTag(std::string const &tag)
Definition: ProxyFactory.cc:29
DataProxyWrapper::m_proxies
std::vector< std::shared_ptr< cond::persistency::PayloadProxy< DataT > > > m_proxies
Definition: DataProxy.h:179
cond::DataProxyWrapperBase::requests
std::shared_ptr< std::vector< Iov_t > > const & requests() const
Definition: DataProxy.h:100
cond::DataProxyWrapperBase::tag
std::string const & tag() const
Definition: DataProxy.h:94
DataProxyWrapper::m_edmProxies
std::vector< edmProxyP > m_edmProxies
Definition: DataProxy.h:180