Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
FWCore
Framework
interface
ModuleContextSentry.h
Go to the documentation of this file.
1
#ifndef FWCore_Framework_ModuleContextSentry_h
2
#define FWCore_Framework_ModuleContextSentry_h
3
4
#include "
FWCore/ServiceRegistry/interface/CurrentModuleOnThread.h
"
5
#include "
FWCore/ServiceRegistry/interface/ModuleCallingContext.h
"
6
#include "
FWCore/ServiceRegistry/interface/ParentContext.h
"
7
#include "
FWCore/Utilities/interface/propagate_const.h
"
8
9
namespace
edm {
10
11
class
ModuleContextSentry
{
12
public
:
13
ModuleContextSentry
(
ModuleCallingContext
* moduleCallingContext,
ParentContext
const
& parentContext)
14
:
moduleCallingContext_
(moduleCallingContext) {
15
moduleCallingContext_
->setContext(
16
ModuleCallingContext::State::kRunning
, parentContext,
CurrentModuleOnThread::getCurrentModuleOnThread
());
17
CurrentModuleOnThread::setCurrentModuleOnThread
(
moduleCallingContext_
);
18
}
19
~ModuleContextSentry
() {
20
CurrentModuleOnThread::setCurrentModuleOnThread
(
moduleCallingContext_
->previousModuleOnThread());
21
moduleCallingContext_
->setContext(
ModuleCallingContext::State::kInvalid
,
ParentContext
(),
nullptr
);
22
}
23
24
private
:
25
edm::propagate_const<ModuleCallingContext*>
moduleCallingContext_
;
26
};
27
}
// namespace edm
28
#endif
edm::propagate_const
Definition:
propagate_const.h:32
edm::ModuleCallingContext
Definition:
ModuleCallingContext.h:32
edm::ModuleCallingContext::State::kRunning
edm::CurrentModuleOnThread::getCurrentModuleOnThread
static ModuleCallingContext const * getCurrentModuleOnThread()
Definition:
CurrentModuleOnThread.h:17
edm::ModuleContextSentry::moduleCallingContext_
edm::propagate_const< ModuleCallingContext * > moduleCallingContext_
Definition:
ModuleContextSentry.h:25
edm::CurrentModuleOnThread::setCurrentModuleOnThread
static void setCurrentModuleOnThread(ModuleCallingContext const *v)
Definition:
CurrentModuleOnThread.h:21
edm::ModuleCallingContext::State::kInvalid
ParentContext.h
CurrentModuleOnThread.h
edm::ModuleContextSentry
Definition:
ModuleContextSentry.h:11
edm::ModuleContextSentry::ModuleContextSentry
ModuleContextSentry(ModuleCallingContext *moduleCallingContext, ParentContext const &parentContext)
Definition:
ModuleContextSentry.h:13
ModuleCallingContext.h
edm::ModuleContextSentry::~ModuleContextSentry
~ModuleContextSentry()
Definition:
ModuleContextSentry.h:19
edm::ParentContext
Definition:
ParentContext.h:27
propagate_const.h
Generated for CMSSW Reference Manual by
1.8.5