ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
SGTools
src
CurrentEventStore.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/CurrentEventStore.h
"
13
#include "
AthenaKernel/ExtendedEventContext.h
"
14
#include "GaudiKernel/ThreadLocalContext.h"
15
16
17
namespace
SG
{
18
19
20
thread_local
IProxyDict* CurrentEventStore::m_curStore =
nullptr
;
21
22
27
IProxyDict* CurrentEventStore::setStore (IProxyDict* store)
28
{
29
IProxyDict* oldstore =
m_curStore
;
30
m_curStore
=
store
;
31
return
oldstore;
32
}
33
34
38
CurrentEventStore::Push::Push (IProxyDict* store)
39
: m_oldStore (
setStore
(
store
))
40
{
41
EventContext ctx = Gaudi::Hive::currentContext();
42
m_oldCtx = ctx;
43
44
Atlas::ExtendedEventContext
* ectx =
Atlas::tryGetExtendedEventContext
(ctx);
45
if
(ectx) {
46
ectx->
setProxy
(store);
47
}
48
else
{
49
ctx.setExtension (
Atlas::ExtendedEventContext
(store));
50
}
51
Gaudi::Hive::setCurrentContext (ctx);
52
}
53
54
58
CurrentEventStore::Push::~Push()
59
{
60
Gaudi::Hive::setCurrentContext (m_oldCtx);
61
setStore
(m_oldStore);
62
}
63
64
65
}
// namespace SG
ExtendedEventContext.h
CurrentEventStore.h
Hold a pointer to the current event store.
Atlas::ExtendedEventContext
Definition
ExtendedEventContext.h:23
Atlas::ExtendedEventContext::setProxy
void setProxy(IProxyDict *proxy)
Definition
ExtendedEventContext.h:33
Atlas::tryGetExtendedEventContext
const ExtendedEventContext * tryGetExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
Definition
ExtendedEventContext.cxx:42
SGTest::store
TestStore store
Definition
TestStore.cxx:22
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
SG::setStore
void setStore(const SG::IConstAuxStore *store)
Set the store associated with this object.
SG::m_curStore
static IProxyDict * m_curStore
The current event store.
Definition
SGTools/SGTools/CurrentEventStore.h:63
Generated on
for ATLAS Offline Software by
1.17.0