Gaudi Framework, version v23r6

Home   Generated: Wed Jan 30 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AlgContextAuditor.cpp
Go to the documentation of this file.
1 #include <cassert>
2 
6 #include "GaudiKernel/SmartIF.h"
8 
9 #include "AlgContextAuditor.h"
10 
11 // ============================================================================
17 // ============================================================================
18 namespace
19 {
28  inline IAlgorithm* toAlg ( IInterface* ni )
29  {
30  if ( 0 == ni ) { return 0 ; }
31  SmartIF<IAlgorithm> alg ( ni ) ;
32  return alg ;
33  }
34 }
35 // ============================================================================
36 // mandatory auditor factory, needed for instantiation
37 // ============================================================================
39 // ============================================================================
40 // standard constructor @see Auditor
41 // ============================================================================
43 ( const std::string& name ,
44  ISvcLocator* pSvc )
45  : Auditor( name , pSvc )
46  , m_svc ( 0 )
47 {}
48 // ============================================================================
49 // destructor
50 // ============================================================================
52 // ============================================================================
53 // standard initialization, see @IAuditor
54 // ============================================================================
56 {
57  // initialize the base class
59  if ( sc.isFailure() ) { return sc ; } // RETURN
60  if ( 0 != m_svc ) { m_svc -> release() ; m_svc = 0 ; }
61  sc = Auditor::service ( "AlgContextSvc" , m_svc , true ) ;
62  if ( sc.isFailure() )
63  {
64  MsgStream log ( msgSvc() , name() ) ;
65  log << MSG::ERROR << "Unable to locate 'AlgContextSvc'" << sc << endmsg ;
66  m_svc = 0 ;
67  return sc ; // RETURN
68  }
69  if ( 0 == m_svc )
70  {
71  MsgStream log ( msgSvc() , name() ) ;
72  log << MSG::ERROR << "Invalid pointer to IAlgContextSvc" << endmsg ;
73  return StatusCode::FAILURE ; // RETURN
74  }
75  return StatusCode::SUCCESS ;
76 }
77 // ============================================================================
78 // standard finalization, see @IAuditor
79 // ============================================================================
81 {
82  if ( 0 != m_svc ) { m_svc-> release() ; m_svc = 0 ; }
83  // finalize the base class
84  return Auditor::finalize () ;
85 }
86 // ============================================================================
88  if ( 0 != m_svc ) {
89  IAlgorithm* alg = toAlg(a);
90  if (alg != 0) m_svc -> setCurrentAlg ( alg ).ignore() ;
91  }
92 }
93 // ============================================================================
95  if ( 0 != m_svc ) {
96  IAlgorithm* alg = toAlg(a);
97  if (alg != 0) m_svc -> unSetCurrentAlg ( alg ).ignore() ;
98  }
99 }
100 // ============================================================================
102  if ( 0 != m_svc ) {
103  IAlgorithm* alg = toAlg(a);
104  if (alg != 0) m_svc -> setCurrentAlg ( alg ).ignore() ;
105  }
106 }
107 // ============================================================================
109  if ( 0 != m_svc ) {
110  IAlgorithm* alg = toAlg(a);
111  if (alg != 0) m_svc -> unSetCurrentAlg ( alg ).ignore() ;
112  }
113 }
114 // ============================================================================
116  if ( 0 != m_svc ) {
117  IAlgorithm* alg = toAlg(a);
118  if (alg != 0) m_svc -> setCurrentAlg ( alg ).ignore() ;
119  }
120 }
121 // ============================================================================
123  const StatusCode& /* s */ ) {
124  if ( 0 != m_svc ) {
125  IAlgorithm* alg = toAlg(a);
126  if (alg != 0) m_svc -> unSetCurrentAlg ( alg ).ignore() ;
127  }
128 }
129 // ============================================================================
130 
131 // ============================================================================
132 // The END
133 // ============================================================================
134 

Generated at Wed Jan 30 2013 17:13:38 for Gaudi Framework, version v23r6 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004