DummyProductCache.cc
Go to the documentation of this file.
2 #include "TClass.h"
4 
5 namespace art {
6  namespace detail {
7 
8  EDProduct const*
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  }
25 
26  } // namespace detail
27 } // namespace art
std::string string
Definition: nybbler.cc:12
std::map< std::string, std::unique_ptr< EDProduct > > dummies_
EDProduct const * product(std::string const &wrappedName)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66