All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ThreadLocalContext.cpp
Go to the documentation of this file.
3 
4 #include "Rtypes.h"
5 #include "ThreadLocalStorage.h"
6 
7 namespace {
8  // MacOS X's clang doesn't provide thread_local. So we need to use ROOT's
9  // thread-local implementation to operate on this platform.
10  EventContext& s_curCtx() {
11  TTHREAD_TLS_DECL( EventContext, localContext );
12  return localContext;
13  }
14 }
15 
16 namespace Gaudi {
17  namespace Hive {
19  return s_curCtx().slot();
20  }
22  return s_curCtx().evt();
23  }
25  return s_curCtx();
26  }
27 
28  void setCurrentContextEvt(long int evtN) {
29  s_curCtx().setEvt(evtN);
30  }
32  s_curCtx().setSlot(newId);
33  }
34 
35  // FIXME: do we need this method?
36  void setCurrentContextId(ContextIdType newId, long int evtN) {
37  s_curCtx().set(evtN,newId);
38  }
39 
40  // FIXME: do we need this method?
41  void setCurrentContextId(const EventContext* ctx) {
42  s_curCtx() = *ctx;
43  }
44 
45  void setCurrentContext(const EventContext* ctx) {
46  s_curCtx() = *ctx;
47  }
48 
49  void setCurrentContext(const EventContext& ctx) {
50  s_curCtx() = ctx;
51  }
52  }
53 }
GAUDI_API ContextIdType currentContextId()
Return the current context id.
GAUDI_API void setCurrentContextId(ContextIdType newId)
Used by the framework to change the value of the current context id.
This class represents an entry point to all the event specific data.
Definition: EventContext.h:25
GAUDI_API const EventContext & currentContext()
GAUDI_API void setCurrentContext(const EventContext *ctx)
GAUDI_API ContextIdType currentContextEvt()
GAUDI_API void setCurrentContextEvt(long int evtN)
Helper functions to set/get the application return code.
Definition: __init__.py:1