FWCore
ServiceRegistry
src
ESParentContext.cc
Go to the documentation of this file.
1
#include "
FWCore/ServiceRegistry/interface/ESParentContext.h
"
2
#include "
FWCore/ServiceRegistry/interface/ModuleCallingContext.h
"
3
#include "
FWCore/ServiceRegistry/interface/ESModuleCallingContext.h
"
4
5
#include "
FWCore/Utilities/interface/EDMException.h
"
6
7
#include <ostream>
8
9
namespace
edm
{
10
11
ESParentContext::ESParentContext
() : type_(
Type
::kInvalid) {
parent_
.
esmodule
=
nullptr
; }
12
13
ESParentContext::ESParentContext
(
ModuleCallingContext
const
* module) noexcept : type_(Type::kModule) {
14
parent_.module = module;
15
}
16
17
ESParentContext::ESParentContext
(
ESModuleCallingContext
const
* module) noexcept : type_(Type::kESModule) {
18
parent_.esmodule = module;
19
}
20
21
ModuleCallingContext
const
*
ESParentContext::moduleCallingContext
()
const
{
22
if
(
type_
!=
Type::kModule
) {
23
throw
Exception
(
errors::LogicError
)
24
<<
"ESParentContext::moduleCallingContext called for incorrect type of context"
;
25
}
26
return
parent_
.
module
;
27
}
28
29
ESModuleCallingContext
const
*
ESParentContext::esmoduleCallingContext
()
const
{
30
if
(
type_
!=
Type::kESModule
) {
31
throw
Exception
(
errors::LogicError
)
32
<<
"ESParentContext::esmoduleCallingContext called for incorrect type of context"
;
33
}
34
return
parent_
.
esmodule
;
35
}
36
}
// namespace edm
ModuleCallingContext.h
edm::ESModuleCallingContext
Definition:
ESModuleCallingContext.h:27
edm::errors::LogicError
Definition:
EDMException.h:37
edm::ESParentContext::type_
Type type_
Definition:
ESParentContext.h:35
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::ESParentContext::Type::kModule
EDMException.h
edm::ESParentContext::Parent::esmodule
ESModuleCallingContext const * esmodule
Definition:
ESParentContext.h:39
edm::ESParentContext::Type::kESModule
edm::ESParentContext::moduleCallingContext
ModuleCallingContext const * moduleCallingContext() const
Definition:
ESParentContext.cc:21
ESParentContext.h
edm::ESParentContext::parent_
union edm::ESParentContext::Parent parent_
edm::ESParentContext::ESParentContext
ESParentContext()
Definition:
ESParentContext.cc:11
edm::ESParentContext::Parent::module
ModuleCallingContext const * module
Definition:
ESParentContext.h:38
Exception
Definition:
hltDiff.cc:245
edm::ESParentContext::Type
Type
Definition:
ESParentContext.h:23
ESModuleCallingContext.h
edm::ESParentContext::esmoduleCallingContext
ESModuleCallingContext const * esmoduleCallingContext() const
Definition:
ESParentContext.cc:29
edm::ModuleCallingContext
Definition:
ModuleCallingContext.h:29
Generated for CMSSW Reference Manual by
1.8.16