/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
FWCore/ServiceRegistry/src/ESModuleCallingContext.cc
43 строки
2 KB
Chris Jones
Added callID to ESModuleCallingContext
27 ноя 2023, 19:18
27 ноя 2023, 19:18
ffa67b5
Код
Авторство
О чём код?
#include "FWCore/ServiceRegistry/interface/ESModuleCallingContext.h" #include "FWCore/ServiceRegistry/interface/ParentContext.h" #include "FWCore/ServiceRegistry/interface/ModuleCallingContext.h" #include "FWCore/Utilities/interface/EDMException.h" #include <ostream> namespace edm { ESModuleCallingContext::ESModuleCallingContext(edm::eventsetup::ComponentDescription const* componentDescription, std::uintptr_t id) : componentDescription_(componentDescription), parent_(), id_(id), state_(State::kInvalid) {} ESModuleCallingContext::ESModuleCallingContext(edm::eventsetup::ComponentDescription const* componentDescription, std::uintptr_t id, State state, ESParentContext const& parent) : componentDescription_(componentDescription), parent_(parent), id_(id), state_(state) {} void ESModuleCallingContext::setContext(State state, ESParentContext const& parent) { state_ = state; parent_ = parent; } ModuleCallingContext const* ESModuleCallingContext::getTopModuleCallingContext() const { ESModuleCallingContext const* mcc = this; while (mcc->type() == ESParentContext::Type::kESModule) { mcc = mcc->esmoduleCallingContext(); } return mcc->moduleCallingContext()->getTopModuleCallingContext(); } unsigned ESModuleCallingContext::depth() const { unsigned depth = 0; ESModuleCallingContext const* mcc = this; while (mcc->type() == ESParentContext::Type::kESModule) { ++depth; mcc = mcc->esmoduleCallingContext(); } return depth + mcc->moduleCallingContext()->depth(); } } // namespace edm