Public Member Functions | Private Attributes | List of all members
art::detail::DummyProductCache Class Reference

#include <DummyProductCache.h>

Public Member Functions

EDProduct const * product (std::string const &wrappedName)
 

Private Attributes

std::map< std::string, std::unique_ptr< EDProduct > > dummies_
 

Detailed Description

Definition at line 13 of file DummyProductCache.h.

Member Function Documentation

EDProduct const * art::detail::DummyProductCache::product ( std::string const &  wrappedName)

Definition at line 9 of file DummyProductCache.cc.

10  {
11  auto it = dummies_.find(wrappedName);
12  if (it == dummies_.cend()) {
13  TClass* cp = TClass::GetClass(wrappedName.c_str());
14  if (cp == nullptr) {
16  << "TClass::GetClass() returned null pointer for name: "
17  << wrappedName << '\n';
18  }
19  std::unique_ptr<EDProduct> dummy{
20  reinterpret_cast<EDProduct*>(cp->New())};
21  it = dummies_.emplace(wrappedName, move(dummy)).first;
22  }
23  return it->second.get();
24  }
std::map< std::string, std::unique_ptr< EDProduct > > dummies_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66

Member Data Documentation

std::map<std::string, std::unique_ptr<EDProduct> > art::detail::DummyProductCache::dummies_
private

Definition at line 18 of file DummyProductCache.h.


The documentation for this class was generated from the following files: