/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
FWCore/Framework/src/resolverMaker.cc
32 строки
1 KB
Matti Kortelainen
Abstract the use of ModuleTypeResolverBase into its own function
14 сен 2022, 16:20
14 сен 2022, 16:20
2bad3e9
Код
Авторство
О чём код?
#include "FWCore/Framework/interface/resolveMaker.h" namespace edm::detail { void annotateResolverMakerExceptionAndRethrow(cms::Exception& except, std::string const& modtype, ModuleTypeResolverBase const* resolver) { if (not resolver) { throw except; } //if needed, create list of alternative types that were tried std::string alternativeTypes; auto index = resolver->kInitialIndex; auto newType = modtype; int tries = 0; do { ++tries; if (not alternativeTypes.empty()) { alternativeTypes.append(", "); } auto [ttype, tindex] = resolver->resolveType(std::move(newType), index); newType = std::move(ttype); index = tindex; alternativeTypes.append(newType); } while (index != resolver->kLastIndex); if (tries == 1 and alternativeTypes == modtype) { throw except; } alternativeTypes.insert(0, "These alternative types were tried: "); except.addAdditionalInfo(alternativeTypes); throw except; } } // namespace edm::detail