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
26IProxyDict* CurrentEventStore::store()
27{
28 return m_curStore;
29}
30
31
36IProxyDict* CurrentEventStore::setStore (IProxyDict* store)
37{
38 IProxyDict* oldstore = m_curStore;
40 return oldstore;
41}
42
43
47CurrentEventStore::Push::Push (IProxyDict* store)
48 : m_oldStore (setStore (store))
49{
50 EventContext ctx = Gaudi::Hive::currentContext();
51 m_oldCtx = ctx;
52
54 if (ectx) {
55 ectx->setProxy (store);
56 }
57 else {
58 ctx.setExtension (Atlas::ExtendedEventContext (store));
59 }
60 Gaudi::Hive::setCurrentContext (ctx);
61}
62
63
67CurrentEventStore::Push::~Push()
68{
69 Gaudi::Hive::setCurrentContext (m_oldCtx);
70 setStore (m_oldStore);
71}
72
73
74} // 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:23
Forward declaration.
void setStore(const SG::IConstAuxStore *store)
Set the store associated with this object.
static IProxyDict * m_curStore
The current event store.