ATLAS Offline Software
CurrentEventStore.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Id$
6 /**
7  * @file SGTools/CurrentEventStore.icc
8  * @author scott snyder <snyder@bnl.gov>
9  * @date Apr, 2015
10  * @brief Hold a pointer to the current event store.
11  */
12 
13 
14 namespace SG {
15 /**
16  * @brief Fetch the current store.
17  */
18 inline
19 IProxyDict* CurrentEventStore::store()
20 {
21  // Accessing a thread-local here is in some cases triggering
22  // an internal error in cling (as of root 6.06.06).
23  // Have cling call an out-of-line function for thread-local access
24  // rather than inlining it.
25 #ifdef __CLING__
26  return storeOol();
27 #else
28  return m_curStore;
29 #endif
30 }
31 
32 
33 /**
34  * @brief Temporarily change the current event store.
35  */
36 inline
37 CurrentEventStore::Push::Push (IProxyDict* store)
38  : m_oldStore (setStore (store))
39 {
40 }
41 
42 
43 /**
44  * @brief Restore the current event store.
45  */
46 inline
47 CurrentEventStore::Push::~Push()
48 {
49  setStore (m_oldStore);
50 }
51 
52 
53 } // namespace SG