ATLAS Offline Software
Loading...
Searching...
No Matches
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
14#include "GaudiKernel/ThreadLocalContext.h"
15
16
17namespace SG {
18
19
20thread_local IProxyDict* CurrentEventStore::m_curStore = nullptr;
21
22
27IProxyDict* CurrentEventStore::setStore (IProxyDict* store)
28{
29 IProxyDict* oldstore = m_curStore;
31 return oldstore;
32}
33
34
38CurrentEventStore::Push::Push (IProxyDict* store)
39 : m_oldStore (setStore (store))
40{
41 EventContext ctx = Gaudi::Hive::currentContext();
42 m_oldCtx = ctx;
43
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
58CurrentEventStore::Push::~Push()
59{
60 Gaudi::Hive::setCurrentContext (m_oldCtx);
61 setStore (m_oldStore);
62}
63
64
65} // namespace SG
Hold a pointer to the current event store.
void setProxy(IProxyDict *proxy)
const ExtendedEventContext * tryGetExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
TestStore store
Definition TestStore.cxx:22
Forward declaration.
void setStore(const SG::IConstAuxStore *store)
Set the store associated with this object.
static IProxyDict * m_curStore
The current event store.