CMS 3D CMS Logo

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

#include <ProductResolver.h>

Inheritance diagram for ProductResolverWrapper< RecordT, DataT, Initializer >:
cond::ProductResolverWrapperBase

Public Types

typedef ::cond::ProductResolver< RecordT, DataT, Initializer > ProductResolver
 
- Public Types inherited from cond::ProductResolverWrapperBase
typedef std::pair< std::string, std::string > Args
 
typedef std::shared_ptr< edm::eventsetup::ESProductResolveresResolverP
 
typedef std::shared_ptr< cond::persistency::BasePayloadProxyProxyP
 

Public Member Functions

esResolverP esResolver (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
 
 ProductResolverWrapper (const char *source=nullptr)
 
ProxyP proxy (unsigned int iovIndex) const override
 
edm::eventsetup::TypeTag type () const override
 
- Public Member Functions inherited from cond::ProductResolverWrapperBase
void addInfo (std::string const &il, std::string const &cs, std::string const &tag)
 
std::string const & connString () const
 
Iov_t const & currentIov () const
 
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)
 
 ProductResolverWrapperBase ()
 
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 ~ProductResolverWrapperBase ()
 

Private Attributes

std::vector< std::shared_ptr< ProductResolver > > m_esResolvers
 
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 ProductResolverWrapper< RecordT, DataT, Initializer >

Definition at line 123 of file ProductResolver.h.

Member Typedef Documentation

◆ ProductResolver

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
typedef ::cond::ProductResolver<RecordT, DataT, Initializer> ProductResolverWrapper< RecordT, DataT, Initializer >::ProductResolver

Definition at line 125 of file ProductResolver.h.

Constructor & Destructor Documentation

◆ ProductResolverWrapper()

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

Definition at line 128 of file ProductResolver.h.

128  : m_source(source ? source : "") {
129  //NOTE: We do this so that the type 'DataT' will get registered
130  // when the plugin is dynamically loaded
131  m_type = edm::eventsetup::DataKey::makeTypeTag<DataT>();
132  }
edm::eventsetup::TypeTag m_type
static std::string const source
Definition: EdmProvDump.cc:49

Member Function Documentation

◆ esResolver()

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
esResolverP ProductResolverWrapper< RecordT, DataT, Initializer >::esResolver ( unsigned int  iovIndex) const
inlineoverridevirtual

Implements cond::ProductResolverWrapperBase.

Definition at line 175 of file ProductResolver.h.

175 { return m_esResolvers.at(iovIndex); }
std::vector< std::shared_ptr< ProductResolver > > m_esResolvers

◆ initConcurrentIOVs()

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

Implements cond::ProductResolverWrapperBase.

Definition at line 153 of file ProductResolver.h.

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

◆ lateInit()

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
void ProductResolverWrapper< 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::ProductResolverWrapperBase.

Definition at line 135 of file ProductResolver.h.

141  {
142  setSession(iSession);
143  // set the IOVProxy
145  // Only make the first PayloadProxy object now because we don't know yet
146  // how many we will need.
147  m_proxies.push_back(std::make_shared<cond::persistency::PayloadProxy<DataT>>(
148  &currentIov(), &session(), &requests(), m_source.empty() ? (const char*)nullptr : m_source.c_str()));
149  m_esResolvers.push_back(std::make_shared<ProductResolver>(m_proxies[0], queue, mutex));
150  addInfo(il, cs, tag);
151  }
static std::mutex mutex
Definition: Proxy.cc:8
void loadTag(std::string const &tag)
void setSession(persistency::Session const &v)
std::shared_ptr< std::vector< Iov_t > > const & requests() const
Iov_t const & currentIov() const
void addInfo(std::string const &il, std::string const &cs, std::string const &tag)
std::string const & tag() const
std::vector< std::shared_ptr< ProductResolver > > m_esResolvers
std::vector< std::shared_ptr< cond::persistency::PayloadProxy< DataT > > > m_proxies
persistency::Session & session()

◆ proxy()

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

Implements cond::ProductResolverWrapperBase.

Definition at line 174 of file ProductResolver.h.

174 { return m_proxies.at(iovIndex); }
std::vector< std::shared_ptr< cond::persistency::PayloadProxy< DataT > > > m_proxies

◆ type()

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

Implements cond::ProductResolverWrapperBase.

Definition at line 173 of file ProductResolver.h.

173 { return m_type; }
edm::eventsetup::TypeTag m_type

Member Data Documentation

◆ m_esResolvers

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
std::vector<std::shared_ptr<ProductResolver> > ProductResolverWrapper< RecordT, DataT, Initializer >::m_esResolvers
private

◆ m_proxies

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

◆ m_source

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

◆ m_type

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
edm::eventsetup::TypeTag ProductResolverWrapper< RecordT, DataT, Initializer >::m_type
private