ThreadLocalContext.cpp
Go to the documentation of this file.
3 
4 static thread_local EventContext s_curCtx;
5 
6 namespace Gaudi {
7  namespace Hive {
9  return s_curCtx.slot();
10  }
12  return s_curCtx.evt();
13  }
15  return s_curCtx;
16  }
17 
18  void setCurrentContextEvt(long int evtN) {
19  s_curCtx.setEvt(evtN);
20  }
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_API ContextIdType currentContextId()
Return the current context id.
void setEvt(const ContextEvt_t &e)
Definition: EventContext.h:55
GAUDI_API void setCurrentContextId(ContextIdType newId)
Used by the framework to change the value of the current context id.
ContextID_t slot() const
Definition: EventContext.h:41
void setSlot(const ContextID_t &s)
Definition: EventContext.h:60
This class represents an entry point to all the event specific data.
Definition: EventContext.h:25
GAUDI_API EventContext currentContext()
ContextEvt_t evt() const
Definition: EventContext.h:40
GAUDI_API void setCurrentContext(const EventContext *ctx)
GAUDI_API ContextIdType currentContextEvt()
GAUDI_API void setCurrentContextEvt(long int evtN)
void set(const ContextEvt_t &e=0, const ContextID_t &s=INVALID_CONTEXT_ID, const bool f=false)
Definition: EventContext.h:47
Helper functions to set/get the application return code.
Definition: __init__.py:1