LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
DummyProductCache.cc
Go to the documentation of this file.
2 #include "TClass.h"
4 
5 namespace art {
6  namespace detail {
7 
8  EDProduct const*
9  DummyProductCache::product(std::string const& wrappedName)
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 }
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
HLT enums.