Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
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 } // namespace
15 
16 namespace Gaudi {
17  namespace Hive {
18  ContextIdType currentContextId() { return s_curCtx().slot(); }
19  ContextIdType currentContextEvt() { return s_curCtx().evt(); }
20  const EventContext& currentContext() { return s_curCtx(); }
21 
22  void setCurrentContextEvt( long int evtN ) { s_curCtx().setEvt( evtN ); }
23  void setCurrentContextId( ContextIdType newId ) { s_curCtx().setSlot( newId ); }
24 
25  // FIXME: do we need this method?
26  void setCurrentContextId( ContextIdType newId, long int evtN ) { s_curCtx().set( evtN, newId ); }
27 
28  // FIXME: do we need this method?
29  void setCurrentContextId( const EventContext* ctx ) { s_curCtx() = *ctx; }
30 
31  void setCurrentContext( const EventContext* ctx ) { s_curCtx() = *ctx; }
32 
33  void setCurrentContext( const EventContext& ctx ) { s_curCtx() = ctx; }
34  } // namespace Hive
35 } // namespace Gaudi
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:31
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