| The Gaudi Framework v27r1

- 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 static thread_local EventContext s_curCtx;
5
6 namespace Gaudi {
7 namespace Hive {
8 ContextIdType currentContextId() {
9 return s_curCtx.slot();
10 }
11 ContextIdType currentContextEvt() {
12 return s_curCtx.evt();
13 }
14 EventContext currentContext() {
15 return s_curCtx;
16 }
17
18 void setCurrentContextEvt(long int evtN) {
19 s_curCtx.setEvt(evtN);
20 }
21 void setCurrentContextId(ContextIdType newId) {
22 s_curCtx.setSlot(newId);
23 }
24
25 // FIXME: do we need this method?
26 void setCurrentContextId(ContextIdType newId, long int evtN) {
27 s_curCtx.set(evtN,newId);
28 }
29
30 // FIXME: do we need this method?
31 void setCurrentContextId(const EventContext* ctx) {
32 s_curCtx = *ctx;
33 }
34
35 void setCurrentContext(const EventContext* ctx) {
36 s_curCtx = *ctx;
37 }
38
39 void setCurrentContext(const EventContext& ctx) {
40 s_curCtx = ctx;
41 }
42 }
43 }
Gaudi::Hive::currentContextId
GAUDI_API ContextIdType currentContextId()
Return the current context id.
Definition: ThreadLocalContext.cpp:8
EventContext::setEvt
void setEvt(const ContextEvt_t &e)
Definition: EventContext.h:55
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:21
EventContext::slot
ContextID_t slot() const
Definition: EventContext.h:41
ThreadLocalContext.h
EventContext.h
EventContext::setSlot
void setSlot(const ContextID_t &s)
Definition: EventContext.h:60
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 EventContext currentContext()
Definition: ThreadLocalContext.cpp:14
EventContext::evt
ContextEvt_t evt() const
Definition: EventContext.h:40
Gaudi::Hive::setCurrentContext
GAUDI_API void setCurrentContext(const EventContext *ctx)
Definition: ThreadLocalContext.cpp:35
Gaudi::Hive::currentContextEvt
GAUDI_API ContextIdType currentContextEvt()
Definition: ThreadLocalContext.cpp:11
Hive
Definition: HiveEventRegistryEntry.h:24
Gaudi::Hive::setCurrentContextEvt
GAUDI_API void setCurrentContextEvt(long int evtN)
Definition: ThreadLocalContext.cpp:18
EventContext::set
void set(const ContextEvt_t &e=0, const ContextID_t &s=INVALID_CONTEXT_ID, const bool f=false)
Definition: EventContext.h:47
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1