ATLAS Offline Software
Loading...
Searching...
No Matches
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
14#include "GaudiKernel/ThreadLocalContext.h"
15
16
17namespace SG {
18
19
27 : m_oldCtx (Gaudi::Hive::currentContext())
28{
29}
30
31
39WithEventContext::WithEventContext (const EventContext& ctx)
41{
42 Gaudi::Hive::setCurrentContext (ctx);
43}
44
45
56{
57 EventContext ctx = m_oldCtx;
58
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
74{
75 Gaudi::Hive::setCurrentContext (m_oldCtx);
76}
77
78
79} // namespace SG
Temporarily change the current EventContext.
void setProxy(IProxyDict *proxy)
EventContext m_oldCtx
The saved original EventContext.
WithEventContext()
Save current EventContext.
const ExtendedEventContext * tryGetExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
=============================================================================
Forward declaration.