| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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 {
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::Hive::currentContextId
GAUDI_API ContextIdType currentContextId()
Return the current context id.
Definition: ThreadLocalContext.cpp:22
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:27
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:24
Gaudi::Hive::setCurrentContext
GAUDI_API void setCurrentContext(const EventContext *ctx)
Definition: ThreadLocalContext.cpp:35
Gaudi::Hive::currentContextEvt
GAUDI_API ContextIdType currentContextEvt()
Definition: ThreadLocalContext.cpp:23
Hive
Definition: HiveEventRegistryEntry.h:24
Gaudi::Hive::setCurrentContextEvt
GAUDI_API void setCurrentContextEvt(long int evtN)
Definition: ThreadLocalContext.cpp:26
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1