ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
SGTools
src
WithEventContext.cxx
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration.
3
*/
10
11
12
#include "
SGTools/WithEventContext.h
"
13
#include "
AthenaKernel/ExtendedEventContext.h
"
14
#include "GaudiKernel/ThreadLocalContext.h"
15
16
17
namespace
SG
{
18
19
26
WithEventContext::WithEventContext
()
27
:
m_oldCtx
(
Gaudi
::Hive::currentContext())
28
{
29
}
30
31
39
WithEventContext::WithEventContext
(
const
EventContext& ctx)
40
:
WithEventContext
()
41
{
42
Gaudi::Hive::setCurrentContext (ctx);
43
}
44
45
54
WithEventContext::WithEventContext
(
IProxyDict
* sg)
55
:
WithEventContext
()
56
{
57
EventContext ctx =
m_oldCtx
;
58
59
Atlas::ExtendedEventContext
* ectx =
Atlas::tryGetExtendedEventContext
(ctx);
60
if
(ectx) {
61
ectx->
setProxy
(sg);
62
}
63
else
{
64
ctx.setExtension (
Atlas::ExtendedEventContext
(sg));
65
}
66
Gaudi::Hive::setCurrentContext (std::move (ctx));
67
}
68
69
73
WithEventContext::~WithEventContext
()
74
{
75
Gaudi::Hive::setCurrentContext (
m_oldCtx
);
76
}
77
78
79
}
// namespace SG
ExtendedEventContext.h
WithEventContext.h
Temporarily change the current EventContext.
Atlas::ExtendedEventContext
Definition
ExtendedEventContext.h:23
Atlas::ExtendedEventContext::setProxy
void setProxy(IProxyDict *proxy)
Definition
ExtendedEventContext.h:33
IProxyDict
A proxy dictionary.
Definition
AthenaKernel/AthenaKernel/IProxyDict.h:48
SG::WithEventContext::m_oldCtx
EventContext m_oldCtx
The saved original EventContext.
Definition
WithEventContext.h:72
SG::WithEventContext::WithEventContext
WithEventContext()
Save current EventContext.
Definition
WithEventContext.cxx:26
SG::WithEventContext::~WithEventContext
~WithEventContext()
Destructor.
Definition
WithEventContext.cxx:73
Atlas::tryGetExtendedEventContext
const ExtendedEventContext * tryGetExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
Definition
ExtendedEventContext.cxx:42
Gaudi
=============================================================================
Definition
CaloGPUClusterAndCellDataMonitorOptions.h:274
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
Generated on
for ATLAS Offline Software by
1.17.0