![]() |
|
|
Generated: 18 Jul 2008 |
#include <IAlgContextSvc.h>
Collaboration diagram for Gaudi::Utils::AlgContext:

Typical explicit usage:
StatusCode MyAlg::execute() { IAlgContextSvc* acs = ... ; // define the context Gaudi::Utils::AlgContext sentry ( this , acs ) ; ... return StatusCode::SUCCESS ; }
Note: for the regular job the context is properly defined with the help of corresponding auditor AlgContextAuditor. This helper class is needed only if one needs to ensure that the algorithm must register its context independently on job/auditor configuration
Definition at line 84 of file IAlgContextSvc.h.
Public Member Functions | |
| AlgContext (IAlgContextSvc *svc, IAlgorithm *alg) | |
| constructor from the service and the algorithm Internally invokes IAlgContextSvc::setCurrentAlg | |
| AlgContext (IAlgorithm *alg, IAlgContextSvc *svc) | |
| constructor from the algorithm and the service Internally invokes IAlgContextSvc::setCurrentAlg | |
| ~AlgContext () | |
| destructor Internally invokes IAlgContextSvc::unSetCurrentAlg | |
Private Member Functions | |
| AlgContext () | |
| no default constructor! | |
| AlgContext (const AlgContext &right) | |
| no copy! | |
| AlgContext & | operator= (const AlgContext &right) |
| no assignement! | |
Private Attributes | |
| IAlgContextSvc * | m_svc |
| IAlgorithm * | m_alg |
| Gaudi::Utils::AlgContext::AlgContext | ( | IAlgContextSvc * | svc, | |
| IAlgorithm * | alg | |||
| ) |
constructor from the service and the algorithm Internally invokes IAlgContextSvc::setCurrentAlg
| svc | pointer to algorithm context service | |
| alg | pointer to the current algorithm |
Definition at line 50 of file AlgContext.cpp.
00052 : m_svc ( svc ) 00053 , m_alg ( alg ) 00054 { 00055 if ( 0 != m_alg ) { m_alg -> addRef() ; } 00056 if ( 0 != m_svc ) { m_svc -> addRef() ; } 00057 if ( 0 != m_svc && 0 != m_alg ) { m_svc->setCurrentAlg ( m_alg ).ignore() ; } 00058 }
| Gaudi::Utils::AlgContext::AlgContext | ( | IAlgorithm * | alg, | |
| IAlgContextSvc * | svc | |||
| ) |
constructor from the algorithm and the service Internally invokes IAlgContextSvc::setCurrentAlg
| alg | pointer to the current algorithm | |
| svc | pointer to algorithm context service |
Definition at line 69 of file AlgContext.cpp.
00071 : m_svc ( svc ) 00072 , m_alg ( alg ) 00073 { 00074 if ( 0 != m_alg ) { m_alg -> addRef() ; } 00075 if ( 0 != m_svc ) { m_svc -> addRef() ; } 00076 if ( 0 != m_svc && 0 != m_alg ) { m_svc->setCurrentAlg ( m_alg ).ignore() ; } 00077 }
| Gaudi::Utils::AlgContext::~AlgContext | ( | ) |
destructor Internally invokes IAlgContextSvc::unSetCurrentAlg
Definition at line 85 of file AlgContext.cpp.
References StatusCode::ignore(), m_alg, m_svc, and IAlgContextSvc::unSetCurrentAlg().
00086 { 00087 if ( 0 != m_svc && 0 != m_alg ) 00088 { m_svc->unSetCurrentAlg ( m_alg ).ignore() ; } 00089 if ( 0 != m_svc ) { m_svc -> release () ; m_svc = 0 ; } 00090 if ( 0 != m_alg ) { m_alg -> release () ; m_alg = 0 ; } 00091 }
| Gaudi::Utils::AlgContext::AlgContext | ( | ) | [private] |
no default constructor!
| Gaudi::Utils::AlgContext::AlgContext | ( | const AlgContext & | right | ) | [private] |
no copy!
| AlgContext& Gaudi::Utils::AlgContext::operator= | ( | const AlgContext & | right | ) | [private] |
no assignement!
IAlgContextSvc* Gaudi::Utils::AlgContext::m_svc [private] |
IAlgorithm* Gaudi::Utils::AlgContext::m_alg [private] |