The Gaudi Framework  v32r2 (46d42edc)
AlgContext.cpp
Go to the documentation of this file.
4 
11 namespace {
12  // This dummy context is needed for the AlgContect constructor for single thread cases (initialize, finalize, etc.).
13  static const EventContext s_dummyDefaultCtx;
14 } // namespace
15 
17  : m_svc( svc ), m_alg( alg ), m_context( context ) {
18  if ( m_svc && m_alg ) { m_svc->setCurrentAlg( m_alg.get(), m_context ).ignore(); }
19 }
20 
22  : AlgContext( alg, svc, s_dummyDefaultCtx ) {}
23 
25  if ( m_svc && m_alg ) { m_svc->unSetCurrentAlg( m_alg.get(), m_context ).ignore(); }
26 }
Helper "sentry" class to automatize the safe register/unregister the algorithm's context.
~AlgContext()
destructor Internally invokes IAlgContextSvc::unSetCurrentAlg
Definition: AlgContext.cpp:24
const EventContext & m_context
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
This class represents an entry point to all the event specific data.
Definition: EventContext.h:24
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:28
SmartIF< IAlgContextSvc > m_svc
An abstract interface for Algorithm Context Service.
AlgContext(IAlgorithm *alg, IAlgContextSvc *svc, const EventContext &context)
constructor from the service and the algorithm Internally invokes IAlgContextSvc::setCurrentAlg
Definition: AlgContext.cpp:16
virtual StatusCode setCurrentAlg(IAlgorithm *a, const EventContext &context)=0
set the currently executing algorithm ("push_back")
SmartIF< IAlgorithm > m_alg