All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ExceptionSvc.h
Go to the documentation of this file.
1 #ifndef GAUDISVC_EXCEPTIONSVC_H
2 #define GAUDISVC_EXCEPTIONSVC_H
3 // ============================================================================
4 // Include files
5 // ============================================================================
6 // GaudiKernel
7 // ============================================================================
9 #include "GaudiKernel/Service.h"
10 #include "GaudiKernel/MsgStream.h"
11 // ============================================================================
18 // ============================================================================
19 class ExceptionSvc: public extends1<Service, IExceptionSvc> {
20 public:
22  virtual StatusCode handle
23  ( const INamedInterface& o ,
24  const GaudiException& e ) const ;
25  virtual StatusCode handle
27  ( const INamedInterface& o ,
28  const std::exception & e ) const ;
29  virtual StatusCode handle
31  ( const INamedInterface& o ) const ;
32  virtual StatusCode handleErr
34  ( const INamedInterface& o ,
35  const StatusCode& s ) const ;
36 public:
38  virtual StatusCode initialize () ;
40  virtual StatusCode finalize () ;
41 public:
47  ( const std::string& name ,
48  ISvcLocator* svc ) ;
50  virtual ~ExceptionSvc();
51 private:
52  // default constructor is disabled
53  ExceptionSvc () ;
54  // copy constructor is disabled
55  ExceptionSvc ( const ExceptionSvc& ) ;
56  // assignment operator is disabled
57  ExceptionSvc& operator=( const ExceptionSvc& ) ;
58  // process exceptions
59  virtual StatusCode process ( const INamedInterface& o ) const ;
60 private:
61 
62  enum Policy { ALL, NONE };
64 
67  std::map<std::string,ReturnState> m_retCodesExc, m_retCodesErr;
68 
69  mutable MsgStream m_log;
70 
71 };
72 
73 // ============================================================================
74 #endif // GAUDISVC_EXCEPTIONSVC_H
75 // ============================================================================
76 // The END
77 // ============================================================================
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Define general base for Gaudi exception.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:26
virtual StatusCode initialize()
initialize the service
std::map< std::string, ReturnState > m_retCodesErr
Definition: ExceptionSvc.h:67
virtual StatusCode handleErr(const INamedInterface &o, const StatusCode &s) const
Handle errors.
virtual StatusCode handle(const INamedInterface &o, const GaudiException &e) const
Handle caught GaudiExceptions.
Policy m_mode_exc
Definition: ExceptionSvc.h:65
StringProperty m_mode_err_s
Definition: ExceptionSvc.h:66
ExceptionSvc()
no default constructor
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
Simple implementation of IExceptionSvc abstract interface.
Definition: ExceptionSvc.h:19
StringProperty m_mode_exc_s
Definition: ExceptionSvc.h:66
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
std::map< std::string, ReturnState > m_retCodesExc
Definition: ExceptionSvc.h:67
IInterface compliant class extending IInterface with the name() method.
virtual StatusCode finalize()
finalize the service
string s
Definition: gaudirun.py:210
virtual ~ExceptionSvc()
Destructor.
Policy m_mode_err
Definition: ExceptionSvc.h:65
virtual StatusCode process(const INamedInterface &o) const
ExceptionSvc & operator=(const ExceptionSvc &)
no assignement
MsgStream m_log
Definition: ExceptionSvc.h:69