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, edm::SerialTaskQueue *queue, std::mutex *mutex) 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< std::shared_ptr< DataProxy > > m_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 127 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 129 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 132 of file DataProxy.h.

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

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 179 of file DataProxy.h.

179 { 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 157 of file DataProxy.h.

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

◆ 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,
edm::SerialTaskQueue queue,
std::mutex mutex 
)
inlineoverridevirtual

Implements cond::DataProxyWrapperBase.

Definition at line 139 of file DataProxy.h.

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

◆ 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 178 of file DataProxy.h.

178 { 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 177 of file DataProxy.h.

177 { return m_type; }

Member Data Documentation

◆ m_edmProxies

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
std::vector<std::shared_ptr<DataProxy> > 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:428
cond::persistency::PayloadProxy
Definition: PayloadProxy.h:61
fwrapper::cs
unique_ptr< ClusterSequence > cs
Definition: fastjetfortran_madfks.cc:47
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:103
loadRecoTauTagMVAsFromPrepDB_cfi.snapshotTime
snapshotTime
Definition: loadRecoTauTagMVAsFromPrepDB_cfi.py:10
DataProxyWrapper::m_type
edm::eventsetup::TypeTag m_type
Definition: DataProxy.h:183
cms::cuda::assert
assert(be >=bs)
DataProxyWrapper::m_edmProxies
std::vector< std::shared_ptr< DataProxy > > m_edmProxies
Definition: DataProxy.h:185
source
static const std::string source
Definition: EdmProvDump.cc:47
cond::DataProxyWrapperBase::session
persistency::Session & session()
Definition: DataProxy.h:99
createBeamHaloJobs.queue
queue
Definition: createBeamHaloJobs.py:343
cond::DataProxyWrapperBase::currentIov
Iov_t const & currentIov() const
Definition: DataProxy.h:98
DataProxyWrapper::m_source
std::string m_source
Definition: DataProxy.h:182
mutex
static std::mutex mutex
Definition: Proxy.cc:8
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:184
cond::DataProxyWrapperBase::requests
std::shared_ptr< std::vector< Iov_t > > const & requests() const
Definition: DataProxy.h:101
cond::DataProxyWrapperBase::tag
std::string const & tag() const
Definition: DataProxy.h:95