The Gaudi Framework  v29r0 (ff2e7097)
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 // ============================================================================
10 #include "GaudiKernel/Service.h"
11 // ============================================================================
18 // ============================================================================
19 class ExceptionSvc : public extends<Service, IExceptionSvc>
20 {
21 public:
23  StatusCode handle( const INamedInterface& o, const GaudiException& e ) const override;
24  StatusCode handle( const INamedInterface& o, const std::exception& e ) const override;
26  StatusCode handle( const INamedInterface& o ) const override;
28  StatusCode handleErr( const INamedInterface& o, const StatusCode& s ) const override;
30 public:
32  StatusCode initialize() override;
33 
34 public:
35  using extends::extends;
37  ~ExceptionSvc() override = default;
38 
39 private:
40  // default constructor is disabled
41  ExceptionSvc() = delete;
42  // copy constructor is disabled
43  ExceptionSvc( const ExceptionSvc& ) = delete;
44  // assignment operator is disabled
45  ExceptionSvc& operator=( const ExceptionSvc& ) = delete;
46  // process exceptions
47  virtual StatusCode process( const INamedInterface& o ) const;
48 
49 private:
50  enum Policy { ALL, NONE };
52 
55 
57  Gaudi::Property<std::string> m_mode_err_s{this, "Errors", "NONE"};
58 };
59 
60 // ============================================================================
61 #endif // GAUDISVC_EXCEPTIONSVC_H
62 // ============================================================================
63 // The END
64 // ============================================================================
Define general base for Gaudi exception.
ExceptionSvc()=delete
no default constructor
ExceptionSvc & operator=(const ExceptionSvc &)=delete
Implementation of property with value of concrete type.
Definition: Property.h:319
Gaudi::Property< std::string > m_mode_err_s
Definition: ExceptionSvc.h:57
Policy m_mode_exc
Definition: ExceptionSvc.h:53
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
Simple implementation of IExceptionSvc abstract interface.
Definition: ExceptionSvc.h:19
StatusCode initialize() override
initialize the service
STL class.
StatusCode handle(const INamedInterface &o, const GaudiException &e) const override
Handle caught GaudiExceptions.
std::map< std::string, ReturnState > m_retCodesExc
Definition: ExceptionSvc.h:54
IInterface compliant class extending IInterface with the name() method.
Gaudi::Property< std::string > m_mode_exc_s
Definition: ExceptionSvc.h:56
std::map< std::string, ReturnState > m_retCodesErr
Definition: ExceptionSvc.h:54
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
StatusCode handleErr(const INamedInterface &o, const StatusCode &s) const override
Handle errors.
string s
Definition: gaudirun.py:253
Policy m_mode_err
Definition: ExceptionSvc.h:53
virtual StatusCode process(const INamedInterface &o) const
~ExceptionSvc() override=default
Destructor.