/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
FWCore/Framework/interface/ModuleContextSentry.h
28 строк
1 KB
W. David Dagenhart
Only changes from scram build code-format-all
30 апр 2019, 22:05
30 апр 2019, 22:05
23d7339
Код
Авторство
О чём код?
#ifndef FWCore_Framework_ModuleContextSentry_h #define FWCore_Framework_ModuleContextSentry_h #include "FWCore/ServiceRegistry/interface/CurrentModuleOnThread.h" #include "FWCore/ServiceRegistry/interface/ModuleCallingContext.h" #include "FWCore/ServiceRegistry/interface/ParentContext.h" #include "FWCore/Utilities/interface/propagate_const.h" namespace edm { class ModuleContextSentry { public: ModuleContextSentry(ModuleCallingContext* moduleCallingContext, ParentContext const& parentContext) : moduleCallingContext_(moduleCallingContext) { moduleCallingContext_->setContext( ModuleCallingContext::State::kRunning, parentContext, CurrentModuleOnThread::getCurrentModuleOnThread()); CurrentModuleOnThread::setCurrentModuleOnThread(moduleCallingContext_); } ~ModuleContextSentry() { CurrentModuleOnThread::setCurrentModuleOnThread(moduleCallingContext_->previousModuleOnThread()); moduleCallingContext_->setContext(ModuleCallingContext::State::kInvalid, ParentContext(), nullptr); } private: edm::propagate_const<ModuleCallingContext*> moduleCallingContext_; }; } // namespace edm #endif