| The Gaudi Framework v28r2p1 (f1a77ff4)

- 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 // 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 {
18 ContextIdType currentContextId() {
19 return s_curCtx().slot();
20 }
21 ContextIdType currentContextEvt() {
22 return s_curCtx().evt();
23 }
24 const EventContext& currentContext() {
25 return s_curCtx();
26 }
27
28 void setCurrentContextEvt(long int evtN) {
29 s_curCtx().setEvt(evtN);
30 }
31 void setCurrentContextId(ContextIdType newId) {
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::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:31
ThreadLocalContext.h
EventContext.h
std::size_t
EventContext
This class represents an entry point to all the event specific data.
Definition: EventContext.h:25
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:45
Gaudi::Hive::currentContextEvt
GAUDI_API ContextIdType currentContextEvt()
Definition: ThreadLocalContext.cpp:21
Hive
Definition: HiveEventRegistryEntry.h:24
Gaudi::Hive::setCurrentContextEvt
GAUDI_API void setCurrentContextEvt(long int evtN)
Definition: ThreadLocalContext.cpp:28
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1