All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules 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 // ============================================================================
8 #include "GaudiKernel/IExceptionSvc.h"
9 #include "GaudiKernel/Service.h"
10 #include "GaudiKernel/MsgStream.h"
11 // ============================================================================
18 // ============================================================================
19 class ExceptionSvc: public extends1<Service, IExceptionSvc> {
20 public:
23  ( const INamedInterface& o ,
24  const GaudiException& e ) const override;
27  ( const INamedInterface& o ,
28  const std::exception & e ) const override;
31  ( const INamedInterface& o ) const override;
34  ( const INamedInterface& o ,
35  const StatusCode& s ) const override;
36 public:
38  StatusCode initialize () override;
39 public:
45  ( const std::string& name ,
46  ISvcLocator* svc ) ;
48  ~ExceptionSvc() override = default;
49 private:
50  // default constructor is disabled
51  ExceptionSvc () = delete;
52  // copy constructor is disabled
53  ExceptionSvc ( const ExceptionSvc& ) = delete;
54  // assignment operator is disabled
55  ExceptionSvc& operator=( const ExceptionSvc& ) = delete;
56  // process exceptions
57  virtual StatusCode process ( const INamedInterface& o ) const ;
58 private:
59 
60  enum Policy { ALL, NONE };
62 
65  std::map<std::string,ReturnState> m_retCodesExc, m_retCodesErr;
66 
67  mutable MsgStream m_log;
68 
69 };
70 
71 // ============================================================================
72 #endif // GAUDISVC_EXCEPTIONSVC_H
73 // ============================================================================
74 // The END
75 // ============================================================================
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:65
StatusCode handle(const INamedInterface &o, const GaudiException &e) const override
Handle caught GaudiExceptions.
Policy m_mode_exc
Definition: ExceptionSvc.h:63
StringProperty m_mode_err_s
Definition: ExceptionSvc.h:64
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:64
StatusCode initialize() override
initialize the service
StatusCode handleErr(const INamedInterface &o, const StatusCode &s) const override
Handle errors.
std::map< std::string, ReturnState > m_retCodesExc
Definition: ExceptionSvc.h:65
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:63
virtual StatusCode process(const INamedInterface &o) const
~ExceptionSvc() override=default
Destructor.
MsgStream m_log
Definition: ExceptionSvc.h:67