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::EventSetupRecordKey recordKey () const final
 
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 125 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 127 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 130 of file ProductResolver.h.

130  : m_source(source ? source : "") {
131  //NOTE: We do this so that the type 'DataT' will get registered
132  // when the plugin is dynamically loaded
133  m_type = edm::eventsetup::DataKey::makeTypeTag<DataT>();
134  }
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 177 of file ProductResolver.h.

177 { 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 155 of file ProductResolver.h.

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

143  {
144  setSession(iSession);
145  // set the IOVProxy
147  // Only make the first PayloadProxy object now because we don't know yet
148  // how many we will need.
149  m_proxies.push_back(std::make_shared<cond::persistency::PayloadProxy<DataT>>(
150  &currentIov(), &session(), &requests(), m_source.empty() ? (const char*)nullptr : m_source.c_str()));
151  m_esResolvers.push_back(std::make_shared<ProductResolver>(m_proxies[0], queue, mutex));
152  addInfo(il, cs, tag);
153  }
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 176 of file ProductResolver.h.

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

◆ recordKey()

template<class RecordT, class DataT, typename Initializer = cond::DefaultInitializer<DataT>>
edm::eventsetup::EventSetupRecordKey ProductResolverWrapper< RecordT, DataT, Initializer >::recordKey ( ) const
inlinefinalvirtual

Implements cond::ProductResolverWrapperBase.

Definition at line 182 of file ProductResolver.h.

182  {
183  return edm::eventsetup::EventSetupRecordKey::makeKey<RecordT>();
184  }

◆ 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 175 of file ProductResolver.h.

175 { 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