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)
 
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 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  }
std::string m_source
Definition: DataProxy.h:181
static std::string const source
Definition: EdmProvDump.cc:49
edm::eventsetup::TypeTag m_type
Definition: DataProxy.h:182

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

178 { return m_edmProxies.at(iovIndex); }
std::vector< std::shared_ptr< DataProxy > > m_edmProxies
Definition: DataProxy.h:184

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

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

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

144  {
145  setSession(iSession);
146  // set the IOVProxy
148  // Only make the first PayloadProxy object now because we don't know yet
149  // how many we will need.
150  m_proxies.push_back(std::make_shared<cond::persistency::PayloadProxy<DataT>>(
151  &currentIov(), &session(), &requests(), m_source.empty() ? (const char*)nullptr : m_source.c_str()));
152  m_edmProxies.push_back(std::make_shared<DataProxy>(m_proxies[0], queue, mutex));
153  addInfo(il, cs, tag);
154  }
std::shared_ptr< std::vector< Iov_t > > const & requests() const
Definition: DataProxy.h:100
void addInfo(std::string const &il, std::string const &cs, std::string const &tag)
Definition: ProxyFactory.cc:23
persistency::Session & session()
Definition: DataProxy.h:98
static std::mutex mutex
Definition: Proxy.cc:8
std::vector< std::shared_ptr< DataProxy > > m_edmProxies
Definition: DataProxy.h:184
void loadTag(std::string const &tag)
Definition: ProxyFactory.cc:29
Iov_t const & currentIov() const
Definition: DataProxy.h:97
std::string const & tag() const
Definition: DataProxy.h:94
void setSession(persistency::Session const &v)
Definition: DataProxy.h:102
std::vector< std::shared_ptr< cond::persistency::PayloadProxy< DataT > > > m_proxies
Definition: DataProxy.h:183
std::string m_source
Definition: DataProxy.h:181

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

177 { return m_proxies.at(iovIndex); }
std::vector< std::shared_ptr< cond::persistency::PayloadProxy< DataT > > > m_proxies
Definition: DataProxy.h:183

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

176 { return m_type; }
edm::eventsetup::TypeTag m_type
Definition: DataProxy.h:182

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