The Gaudi Framework  v30r3 (a5ef0a68)
AlgContext.cpp
Go to the documentation of this file.
1 // ============================================================================
2 // Include files
3 // ============================================================================
4 // GaudiKernel
5 // ============================================================================
8 // ============================================================================
14 // ============================================================================
15 /* constructor from service and algorithm
16  * Internally invokes IAlgContextSvc::setCurrentAlg
17  * @see IAlgorithm
18  * @see IAlgContextSvc
19  * @param svc pointer to algorithm context service
20  * @param alg pointer to the current algorithm
21  */
22 // ============================================================================
23 Gaudi::Utils::AlgContext::AlgContext( IAlgContextSvc* svc, IAlgorithm* alg ) : m_svc( svc ), m_alg( alg )
24 {
25  if ( m_svc && m_alg ) {
26  m_svc->setCurrentAlg( m_alg.get() ).ignore();
27  }
28 }
29 // ============================================================================
30 /* constructor from service and algorithm
31  * Internally invokes IAlgContextSvc::setCurrentAlg
32  * @see IAlgorithm
33  * @see IAlgContextSvc
34  * @param alg pointer to the current algorithm
35  * @param svc pointer to algorithm context service
36  */
37 // ============================================================================
39 {
40  if ( m_svc && m_alg ) {
41  m_svc->setCurrentAlg( m_alg.get() ).ignore();
42  }
43 }
44 // ============================================================================
45 /* destructor
46  * Internally invokes IAlgContextSvc::unSetCurrentAlg
47  * @see IAlgorithm
48  * @see IAlgContextSvc
49  */
50 // ============================================================================
52 {
53  if ( m_svc && m_alg ) {
54  m_svc->unSetCurrentAlg( m_alg.get() ).ignore();
55  }
56 }
57 // ============================================================================
58 
59 // ============================================================================
60 // The END
61 // ============================================================================
~AlgContext()
destructor Internally invokes IAlgContextSvc::unSetCurrentAlg
Definition: AlgContext.cpp:51
virtual StatusCode setCurrentAlg(IAlgorithm *a)=0
set the currently executing algorithm ("push_back")
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:82
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.
virtual StatusCode unSetCurrentAlg(IAlgorithm *a)=0
remove the algorithm ("pop_back")
SmartIF< IAlgorithm > m_alg