Gaudi Framework, version v25r2

Home   Generated: Wed Jun 4 2014
 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 
5 #include "GaudiKernel/SmartIF.h"
7 
8 #include "AlgContextAuditor.h"
9 
10 // ============================================================================
16 // ============================================================================
17 namespace
18 {
27  inline IAlgorithm* toAlg ( IInterface* ni )
28  {
29  if ( 0 == ni ) { return 0 ; }
30  SmartIF<IAlgorithm> alg ( ni ) ;
31  return alg ;
32  }
33 }
34 // ============================================================================
35 // mandatory auditor factory, needed for instantiation
36 // ============================================================================
38 // ============================================================================
39 // standard constructor @see Auditor
40 // ============================================================================
42 ( const std::string& name ,
43  ISvcLocator* pSvc )
44  : Auditor( name , pSvc )
45  , m_svc ( 0 )
46 {}
47 // ============================================================================
48 // destructor
49 // ============================================================================
51 // ============================================================================
52 // standard initialization, see @IAuditor
53 // ============================================================================
55 {
56  // initialize the base class
58  if ( sc.isFailure() ) { return sc ; } // RETURN
59  if ( 0 != m_svc ) { m_svc -> release() ; m_svc = 0 ; }
60  sc = Auditor::service ( "AlgContextSvc" , m_svc , true ) ;
61  if ( sc.isFailure() )
62  {
63  MsgStream log ( msgSvc() , name() ) ;
64  log << MSG::ERROR << "Unable to locate 'AlgContextSvc'" << sc << endmsg ;
65  m_svc = 0 ;
66  return sc ; // RETURN
67  }
68  if ( 0 == m_svc )
69  {
70  MsgStream log ( msgSvc() , name() ) ;
71  log << MSG::ERROR << "Invalid pointer to IAlgContextSvc" << endmsg ;
72  return StatusCode::FAILURE ; // RETURN
73  }
74  return StatusCode::SUCCESS ;
75 }
76 // ============================================================================
77 // standard finalization, see @IAuditor
78 // ============================================================================
80 {
81  if ( 0 != m_svc ) { m_svc-> release() ; m_svc = 0 ; }
82  // finalize the base class
83  return Auditor::finalize () ;
84 }
85 // ============================================================================
87  if ( 0 != m_svc ) {
88  IAlgorithm* alg = toAlg(a);
89  if (alg != 0) m_svc -> setCurrentAlg ( alg ).ignore() ;
90  }
91 }
92 // ============================================================================
94  if ( 0 != m_svc ) {
95  IAlgorithm* alg = toAlg(a);
96  if (alg != 0) m_svc -> unSetCurrentAlg ( alg ).ignore() ;
97  }
98 }
99 // ============================================================================
101  if ( 0 != m_svc ) {
102  IAlgorithm* alg = toAlg(a);
103  if (alg != 0) m_svc -> setCurrentAlg ( alg ).ignore() ;
104  }
105 }
106 // ============================================================================
108  if ( 0 != m_svc ) {
109  IAlgorithm* alg = toAlg(a);
110  if (alg != 0) m_svc -> unSetCurrentAlg ( alg ).ignore() ;
111  }
112 }
113 // ============================================================================
115  if ( 0 != m_svc ) {
116  IAlgorithm* alg = toAlg(a);
117  if (alg != 0) m_svc -> setCurrentAlg ( alg ).ignore() ;
118  }
119 }
120 // ============================================================================
122  const StatusCode& /* s */ ) {
123  if ( 0 != m_svc ) {
124  IAlgorithm* alg = toAlg(a);
125  if (alg != 0) m_svc -> unSetCurrentAlg ( alg ).ignore() ;
126  }
127 }
128 // ============================================================================
129 
130 // ============================================================================
131 // The END
132 // ============================================================================
133 

Generated at Wed Jun 4 2014 14:48:56 for Gaudi Framework, version v25r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004