Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
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,
14
ParentContext
const
& parentContext) :
15
moduleCallingContext_
(moduleCallingContext) {
16
moduleCallingContext_
->setContext(
ModuleCallingContext::State::kPrefetching
, parentContext,
17
CurrentModuleOnThread::getCurrentModuleOnThread
());
18
CurrentModuleOnThread::setCurrentModuleOnThread
(
moduleCallingContext_
);
19
}
20
~ModuleContextSentry
() {
21
CurrentModuleOnThread::setCurrentModuleOnThread
(
moduleCallingContext_
->previousModuleOnThread());
22
moduleCallingContext_
->setContext(
ModuleCallingContext::State::kInvalid
,
ParentContext
(),
nullptr
);
23
}
24
private
:
25
edm::propagate_const<ModuleCallingContext*>
moduleCallingContext_
;
26
};
27
}
28
#endif
edm::propagate_const
Definition:
propagate_const.h:32
edm::ModuleCallingContext
Definition:
ModuleCallingContext.h:30
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:22
edm::ModuleCallingContext::State::kInvalid
ParentContext.h
CurrentModuleOnThread.h
edm::ModuleCallingContext::State::kPrefetching
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:20
edm::ParentContext
Definition:
ParentContext.h:27
propagate_const.h
Generated for CMSSW Reference Manual by
1.8.5