Gaudi Framework, version v20r2

Generated: 18 Jul 2008

AlgContextAuditor Class Reference

#include <AlgContextAuditor.h>

Inheritance diagram for AlgContextAuditor:

Inheritance graph
[legend]
Collaboration diagram for AlgContextAuditor:

Collaboration graph
[legend]
List of all members.

Detailed Description

Description: Rergister/Unregister the AlgContext of each algorithm before entering the algorithm and after leaving it.

Author:
M. Shapiro, LBNL

modified by Vanya BELYAEV ibelyaev@physics.syr.edu

Definition at line 39 of file AlgContextAuditor.h.

Public Member Functions

virtual void beforeInitialize (INamedInterface *a)
virtual void afterInitialize (INamedInterface *a)
virtual void beforeExecute (INamedInterface *a)
virtual void afterExecute (INamedInterface *a, const StatusCode &s)
virtual void beforeFinalize (INamedInterface *a)
virtual void afterFinalize (INamedInterface *a)
 AlgContextAuditor (const std::string &name, ISvcLocator *pSvc)
 standard constructor
virtual ~AlgContextAuditor ()
 virtual desctrutor
virtual StatusCode initialize ()
 standard initialization, see
virtual StatusCode finalize ()
 standard finalization, see

Private Member Functions

 AlgContextAuditor ()
 no default constructor
 AlgContextAuditor (const AlgContextAuditor &)
 no copy constructor
AlgContextAuditoroperator= (const AlgContextAuditor &)
 no assignement

Private Attributes

IAlgContextSvcm_svc
 the pointer to Algorithm Context Service


Constructor & Destructor Documentation

AlgContextAuditor::AlgContextAuditor ( const std::string name,
ISvcLocator pSvc 
)

standard constructor

See also:
Auditor

Definition at line 73 of file AlgContextAuditor.cpp.

00075   : Auditor( name , pSvc )
00076   , m_svc   ( 0    )
00077 {}

AlgContextAuditor::~AlgContextAuditor (  )  [virtual]

virtual desctrutor

Definition at line 81 of file AlgContextAuditor.cpp.

00081 {}

AlgContextAuditor::AlgContextAuditor (  )  [private]

no default constructor

AlgContextAuditor::AlgContextAuditor ( const AlgContextAuditor  )  [private]

no copy constructor


Member Function Documentation

void AlgContextAuditor::beforeInitialize ( INamedInterface a  )  [virtual]

Deprecated:
use before

Reimplemented from Auditor.

Definition at line 117 of file AlgContextAuditor.cpp.

References m_svc, and toAlg().

00117                                                                {
00118   if ( 0 != m_svc ) { 
00119     IAlgorithm* alg = toAlg(a);
00120     if (alg != 0) m_svc -> setCurrentAlg ( alg ).ignore() ; 
00121   }
00122 }

void AlgContextAuditor::afterInitialize ( INamedInterface a  )  [virtual]

Deprecated:
use after

Reimplemented from Auditor.

Definition at line 124 of file AlgContextAuditor.cpp.

References m_svc, and toAlg().

00124                                                                { 
00125   if ( 0 != m_svc ) { 
00126     IAlgorithm* alg = toAlg(a);
00127     if (alg != 0) m_svc -> unSetCurrentAlg ( alg ).ignore() ; 
00128   } 
00129 }

void AlgContextAuditor::beforeExecute ( INamedInterface a  )  [virtual]

Deprecated:
use before

Reimplemented from Auditor.

Definition at line 145 of file AlgContextAuditor.cpp.

References m_svc, and toAlg().

00145                                                                {
00146   if ( 0 != m_svc ) { 
00147     IAlgorithm* alg = toAlg(a);
00148     if (alg != 0) m_svc -> setCurrentAlg ( alg ).ignore() ; 
00149   }
00150 }

void AlgContextAuditor::afterExecute ( INamedInterface a,
const StatusCode s 
) [virtual]

Deprecated:
use after

Reimplemented from Auditor.

Definition at line 152 of file AlgContextAuditor.cpp.

References m_svc, and toAlg().

00153                                                                        { 
00154   if ( 0 != m_svc ) { 
00155     IAlgorithm* alg = toAlg(a);
00156     if (alg != 0) m_svc -> unSetCurrentAlg ( alg ).ignore() ; 
00157   } 
00158 }

void AlgContextAuditor::beforeFinalize ( INamedInterface a  )  [virtual]

Deprecated:
use before

Reimplemented from Auditor.

Definition at line 131 of file AlgContextAuditor.cpp.

References m_svc, and toAlg().

00131                                                                {
00132   if ( 0 != m_svc ) { 
00133     IAlgorithm* alg = toAlg(a);
00134     if (alg != 0) m_svc -> setCurrentAlg ( alg ).ignore() ; 
00135   }
00136 }

void AlgContextAuditor::afterFinalize ( INamedInterface a  )  [virtual]

Deprecated:
use after

Reimplemented from Auditor.

Definition at line 138 of file AlgContextAuditor.cpp.

References m_svc, and toAlg().

00138                                                                { 
00139   if ( 0 != m_svc ) { 
00140     IAlgorithm* alg = toAlg(a);
00141     if (alg != 0) m_svc -> unSetCurrentAlg ( alg ).ignore() ; 
00142   } 
00143 }

StatusCode AlgContextAuditor::initialize (  )  [virtual]

standard initialization, see

Reimplemented from Auditor.

Definition at line 85 of file AlgContextAuditor.cpp.

References endreq(), MSG::ERROR, StatusCode::FAILURE, Auditor::initialize(), StatusCode::isFailure(), m_svc, Auditor::msgSvc(), Auditor::name(), Auditor::release(), Auditor::service(), and StatusCode::SUCCESS.

00086 {
00087   // initialize the base class 
00088   StatusCode sc = Auditor::initialize() ;
00089   if ( sc.isFailure() ) { return sc ; }                           // RETURN 
00090   if ( 0 != m_svc ) { m_svc -> release() ; m_svc = 0 ; }
00091   sc = Auditor::service ( "AlgContextSvc" , m_svc , true ) ;
00092   if ( sc.isFailure() ) 
00093   { 
00094     MsgStream log ( msgSvc() , name() ) ;
00095     log << MSG::ERROR << "Unable to locate 'AlgContextSvc'" << sc << endreq ;
00096     m_svc = 0 ; 
00097     return sc ;  // RETURN 
00098   }               
00099   if ( 0 == m_svc     ) 
00100   { 
00101     MsgStream log ( msgSvc() , name() ) ;
00102     log << MSG::ERROR << "Invalid pointer to IAlgContextSvc" << endreq ;
00103     return StatusCode::FAILURE ;           // RETURN 
00104   }  
00105   return StatusCode::SUCCESS ;
00106 }

StatusCode AlgContextAuditor::finalize (  )  [virtual]

standard finalization, see

Reimplemented from Auditor.

Definition at line 110 of file AlgContextAuditor.cpp.

References Auditor::finalize(), m_svc, and Auditor::release().

00111 {
00112   if ( 0 != m_svc ) { m_svc-> release() ; m_svc = 0 ; }
00113   // finalize the base class 
00114   return Auditor::finalize () ;
00115 } 

AlgContextAuditor& AlgContextAuditor::operator= ( const AlgContextAuditor  )  [private]

no assignement


Member Data Documentation

IAlgContextSvc* AlgContextAuditor::m_svc [private]

the pointer to Algorithm Context Service

Definition at line 73 of file AlgContextAuditor.h.

Referenced by afterExecute(), afterFinalize(), afterInitialize(), beforeExecute(), beforeFinalize(), beforeInitialize(), finalize(), and initialize().


The documentation for this class was generated from the following files:
Generated at Fri Jul 18 12:06:41 2008 for Gaudi Framework, version v20r2 by Doxygen version 1.5.1 written by Dimitri van Heesch, © 1997-2004