The Gaudi Framework
master (9f3f8895)
Toggle main menu visibility
Loading...
Searching...
No Matches
AlgContext.cpp
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2019 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
\***********************************************************************************/
11
#include <
GaudiKernel/IAlgContextSvc.h
>
12
#include <
GaudiKernel/IAlgorithm.h
>
13
#include <
GaudiKernel/ThreadLocalContext.h
>
14
20
21
namespace
{
22
// This dummy context is needed for the AlgContect constructor for single thread cases (initialize, finalize, etc.).
23
static
const
EventContext
s_dummyDefaultCtx;
24
}
// namespace
25
26
Gaudi::Utils::AlgContext::AlgContext
(
IAlgorithm
* alg,
IAlgContextSvc
* svc,
const
EventContext
& context )
27
:
m_svc
( svc ),
m_alg
( alg ),
m_context
( context ) {
28
if
(
m_svc
&&
m_alg
) {
m_svc
->setCurrentAlg(
m_alg
.get(),
m_context
).ignore(); }
29
}
30
31
Gaudi::Utils::AlgContext::AlgContext
(
IAlgorithm
* alg,
IAlgContextSvc
* svc )
32
:
AlgContext
( alg, svc, s_dummyDefaultCtx ) {}
33
34
Gaudi::Utils::AlgContext::~AlgContext
() {
35
if
(
m_svc
&&
m_alg
) {
m_svc
->unSetCurrentAlg(
m_alg
.get(),
m_context
).ignore(); }
36
}
IAlgContextSvc.h
IAlgorithm.h
ThreadLocalContext.h
EventContext
This class represents an entry point to all the event specific data.
Definition
EventContext.h:35
Gaudi::Utils::AlgContext::AlgContext
AlgContext(IAlgorithm *alg, IAlgContextSvc *svc, const EventContext &context)
constructor from the service and the algorithm Internally invokes IAlgContextSvc::setCurrentAlg
Definition
AlgContext.cpp:26
Gaudi::Utils::AlgContext::m_context
const EventContext & m_context
Definition
IAlgContextSvc.h:117
Gaudi::Utils::AlgContext::m_alg
SmartIF< IAlgorithm > m_alg
Definition
IAlgContextSvc.h:116
Gaudi::Utils::AlgContext::~AlgContext
~AlgContext()
destructor Internally invokes IAlgContextSvc::unSetCurrentAlg
Definition
AlgContext.cpp:34
Gaudi::Utils::AlgContext::m_svc
SmartIF< IAlgContextSvc > m_svc
Definition
IAlgContextSvc.h:115
IAlgContextSvc
An abstract interface for Algorithm Context Service.
Definition
IAlgContextSvc.h:25
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition
IAlgorithm.h:37
GaudiKernel
src
Lib
AlgContext.cpp
Generated on
for The Gaudi Framework by
1.17.0