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 extends<Service,
20  IExceptionSvc> {
21 public:
24  ( const INamedInterface& o ,
25  const GaudiException& e ) const override;
28  ( const INamedInterface& o ,
29  const std::exception & e ) const override;
32  ( const INamedInterface& o ) const override;
35  ( const INamedInterface& o ,
36  const StatusCode& s ) const override;
37 public:
39  StatusCode initialize () override;
40 public:
46  ( const std::string& name ,
47  ISvcLocator* svc ) ;
49  ~ExceptionSvc() override = default;
50 private:
51  // default constructor is disabled
52  ExceptionSvc () = delete;
53  // copy constructor is disabled
54  ExceptionSvc ( const ExceptionSvc& ) = delete;
55  // assignment operator is disabled
56  ExceptionSvc& operator=( const ExceptionSvc& ) = delete;
57  // process exceptions
58  virtual StatusCode process ( const INamedInterface& o ) const ;
59 private:
60 
61  enum Policy { ALL, NONE };
63 
67 
68  mutable MsgStream m_log;
69 
70 };
71 
72 // ============================================================================
73 #endif // GAUDISVC_EXCEPTIONSVC_H
74 // ============================================================================
75 // The END
76 // ============================================================================
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:25
ExceptionSvc()=delete
no default constructor
ExceptionSvc & operator=(const ExceptionSvc &)=delete
std::map< std::string, ReturnState > m_retCodesErr
Definition: ExceptionSvc.h:66
StatusCode handle(const INamedInterface &o, const GaudiException &e) const override
Handle caught GaudiExceptions.
Policy m_mode_exc
Definition: ExceptionSvc.h:64
STL class.
StringProperty m_mode_err_s
Definition: ExceptionSvc.h:65
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Simple implementation of IExceptionSvc abstract interface.
Definition: ExceptionSvc.h:19
StringProperty m_mode_exc_s
Definition: ExceptionSvc.h:65
StatusCode initialize() override
initialize the service
STL class.
StatusCode handleErr(const INamedInterface &o, const StatusCode &s) const override
Handle errors.
std::map< std::string, ReturnState > m_retCodesExc
Definition: ExceptionSvc.h:66
IInterface compliant class extending IInterface with the name() method.
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
string s
Definition: gaudirun.py:245
Policy m_mode_err
Definition: ExceptionSvc.h:64
virtual StatusCode process(const INamedInterface &o) const
~ExceptionSvc() override=default
Destructor.
MsgStream m_log
Definition: ExceptionSvc.h:68