| The Gaudi Framework v32r1 (f65d50dc)

ThreadLocalContext.cpp
Go to the documentation of this file.
1 #include "GaudiKernel/ThreadLocalContext.h"
2 #include "GaudiKernel/EventContext.h"
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::Hive::currentContextId
GAUDI_API ContextIdType currentContextId()
Return the current context id.
Definition: ThreadLocalContext.cpp:18
Gaudi::Hive::setCurrentContextId
GAUDI_API void setCurrentContextId(ContextIdType newId)
Used by the framework to change the value of the current context id.
Definition: ThreadLocalContext.cpp:23
ThreadLocalContext.h
EventContext.h
std::size_t
EventContext
This class represents an entry point to all the event specific data.
Definition: EventContext.h:24
Gaudi::Hive::currentContext
GAUDI_API const EventContext & currentContext()
Definition: ThreadLocalContext.cpp:20
Gaudi::Hive::setCurrentContext
GAUDI_API void setCurrentContext(const EventContext *ctx)
Definition: ThreadLocalContext.cpp:31
Gaudi::Hive::currentContextEvt
GAUDI_API ContextIdType currentContextEvt()
Definition: ThreadLocalContext.cpp:19
Gaudi::Hive::setCurrentContextEvt
GAUDI_API void setCurrentContextEvt(long int evtN)
Definition: ThreadLocalContext.cpp:22
Gaudi
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1