All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ContextSpecificPtr.cpp
Go to the documentation of this file.
1 #include "GaudiKernel/ContextSpecificPtr.h"
2 #include "GaudiKernel/ThreadLocalPtr.h"
3 #include "GaudiKernel/EventContext.h"
4 
5 
6 
7 static THREAD_LOCAL_PTR Gaudi::Hive::ContextIdType s_currentContextId(0);
8 static THREAD_LOCAL_PTR long int s_currentContextEvt(-1);
9 
10 namespace Gaudi {
11  namespace Hive {
13  return s_currentContextId;
14  }
16  return s_currentContextEvt;
17  }
18  void setCurrentContextEvt(long int evtN) {
19  s_currentContextEvt = evtN;
20  }
22  s_currentContextId = newId;
23  }
24  void setCurrentContextId(ContextIdType newId, long int evtN) {
25  s_currentContextId = newId;
26  s_currentContextEvt = evtN;
27  }
28 
29  void setCurrentContextId(const EventContext* ctx) {
30  if (ctx != 0) {
31  s_currentContextId = ctx->slot();
32  s_currentContextEvt = ctx->evt();
33  } else {
34  s_currentContextId = 0;
35  s_currentContextEvt = -1;
36  }
37  }
38 
39  }
40 }
size_t ContextIdType
Internal type used for the ContextId.
This class represents an entry point to all the event specific data.
Definition: EventContext.h:22
GAUDI_API void setCurrentContextId(ContextIdType newId)
Used by the framework to change the value of the current context id.
GAUDI_API ContextIdType currentContextId()
Return the current context id.
long int evt() const
Definition: EventContext.h:37
GAUDI_API ContextIdType currentContextEvt()
#define THREAD_LOCAL_PTR
ID_type slot() const
Definition: EventContext.h:38
GAUDI_API void setCurrentContextEvt(long int evtN)
Helper functions to set/get the application return code.
Definition: __init__.py:1