The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
ThreadLocalContext.cpp
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
13
14#include <Rtypes.h>
15#include <ThreadLocalStorage.h>
16
17namespace {
18 // MacOS X's clang doesn't provide thread_local. So we need to use ROOT's
19 // thread-local implementation to operate on this platform.
20 EventContext& s_curCtx() {
21 TTHREAD_TLS_DECL( EventContext, localContext );
22 return localContext;
23 }
24} // namespace
25
26namespace Gaudi {
27 namespace Hive {
28 ContextIdType currentContextId() { return s_curCtx().slot(); }
29 ContextIdType currentContextEvt() { return s_curCtx().evt(); }
30 const EventContext& currentContext() { return s_curCtx(); }
31
32 void setCurrentContextEvt( long int evtN ) { s_curCtx().setEvt( evtN ); }
33 void setCurrentContextId( ContextIdType newId ) { s_curCtx().setSlot( newId ); }
34
35 // FIXME: do we need this method?
36 void setCurrentContextId( ContextIdType newId, long int evtN ) { s_curCtx().set( evtN, newId ); }
37
38 // FIXME: do we need this method?
39 void setCurrentContextId( const EventContext* ctx ) { s_curCtx() = *ctx; }
40
41 void setCurrentContext( const EventContext* ctx ) { s_curCtx() = *ctx; }
42
43 void setCurrentContext( const EventContext& ctx ) { s_curCtx() = ctx; }
44 } // namespace Hive
45} // namespace Gaudi
This class represents an entry point to all the event specific data.
GAUDI_API void setCurrentContextId(ContextIdType newId)
Used by the framework to change the value of the current context id.
GAUDI_API void setCurrentContextEvt(long int evtN)
std::size_t ContextIdType
Internal type used for the ContextId.
GAUDI_API void setCurrentContext(const EventContext *ctx)
GAUDI_API ContextIdType currentContextId()
Return the current context id.
GAUDI_API ContextIdType currentContextEvt()
GAUDI_API const EventContext & currentContext()
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition __init__.py:1