The Gaudi Framework  v30r3 (a5ef0a68)
ThreadLocalContext.cpp
Go to the documentation of this file.
3 
4 #include "Rtypes.h"
5 #include "ThreadLocalStorage.h"
6 
7 namespace
8 {
9  // MacOS X's clang doesn't provide thread_local. So we need to use ROOT's
10  // thread-local implementation to operate on this platform.
11  EventContext& s_curCtx()
12  {
13  TTHREAD_TLS_DECL( EventContext, localContext );
14  return localContext;
15  }
16 }
17 
18 namespace Gaudi
19 {
20  namespace Hive
21  {
22  ContextIdType currentContextId() { return s_curCtx().slot(); }
23  ContextIdType currentContextEvt() { return s_curCtx().evt(); }
24  const EventContext& currentContext() { return s_curCtx(); }
25 
26  void setCurrentContextEvt( long int evtN ) { s_curCtx().setEvt( evtN ); }
27  void setCurrentContextId( ContextIdType newId ) { s_curCtx().setSlot( newId ); }
28 
29  // FIXME: do we need this method?
30  void setCurrentContextId( ContextIdType newId, long int evtN ) { s_curCtx().set( evtN, newId ); }
31 
32  // FIXME: do we need this method?
33  void setCurrentContextId( const EventContext* ctx ) { s_curCtx() = *ctx; }
34 
35  void setCurrentContext( const EventContext* ctx ) { s_curCtx() = *ctx; }
36 
37  void setCurrentContext( const EventContext& ctx ) { s_curCtx() = ctx; }
38  }
39 }
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:24
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