| The Gaudi Framework v32r1 (f65d50dc)

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/MsgStream.h"
10 #include "GaudiKernel/Service.h"
11 // ============================================================================
18 // ============================================================================
19 class ExceptionSvc : public extends<Service, IExceptionSvc> {
20 public:
22 StatusCode handle( const INamedInterface& o, const GaudiException& e ) const override;
23 StatusCode handle( const INamedInterface& o, const std::exception& e ) const override;
25 StatusCode handle( const INamedInterface& o ) const override;
27 StatusCode handleErr( const INamedInterface& o, const StatusCode& s ) const override;
29 public:
31 StatusCode initialize() override;
32
33 public:
34 using extends::extends;
35
36 private:
37 // default constructor is disabled
38 ExceptionSvc() = delete;
39 // copy constructor is disabled
40 ExceptionSvc( const ExceptionSvc& ) = delete;
41 // assignment operator is disabled
42 ExceptionSvc& operator=( const ExceptionSvc& ) = delete;
43 // process exceptions
44 virtual StatusCode process( const INamedInterface& o ) const;
45
46 private:
47 enum Policy { ALL, NONE };
48 enum ReturnState { SUCCESS, FAILURE, RECOVERABLE, RETHROW, DEFAULT };
49
50 Policy m_mode_exc = ALL, m_mode_err = NONE;
51 std::map<std::string, ReturnState> m_retCodesExc, m_retCodesErr;
52
53 Gaudi::Property<std::string> m_mode_exc_s{this, "Catch", "ALL"};
54 Gaudi::Property<std::string> m_mode_err_s{this, "Errors", "NONE"};
55 };
56
57 // ============================================================================
58 #endif // GAUDISVC_EXCEPTIONSVC_H
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
ExceptionSvc::ExceptionSvc
ExceptionSvc()=delete
no default constructor
ExceptionSvc::operator=
ExceptionSvc & operator=(const ExceptionSvc &)=delete
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:352
MsgStream.h
ExceptionSvc::handle
StatusCode handle(const INamedInterface &o, const GaudiException &e) const override
Handle caught GaudiExceptions.
Definition: ExceptionSvc.cpp:208
ExceptionSvc::m_mode_err_s
Gaudi::Property< std::string > m_mode_err_s
Definition: ExceptionSvc.h:54
ExceptionSvc::ALL
Definition: ExceptionSvc.h:47
std::map< std::string, ReturnState >
ExceptionSvc::m_mode_exc
Policy m_mode_exc
Definition: ExceptionSvc.h:50
Service.h
ExceptionSvc::RETHROW
Definition: ExceptionSvc.h:48
ExceptionSvc::RECOVERABLE
Definition: ExceptionSvc.h:48
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
ExceptionSvc
Simple implementation of IExceptionSvc abstract interface.
Definition: ExceptionSvc.h:19
ExceptionSvc::initialize
StatusCode initialize() override
initialize the service
Definition: ExceptionSvc.cpp:30
std::exception
STL class.
ExceptionSvc::m_retCodesExc
std::map< std::string, ReturnState > m_retCodesExc
Definition: ExceptionSvc.h:51
ExceptionSvc::handleErr
StatusCode handleErr(const INamedInterface &o, const StatusCode &s) const override
Handle errors.
Definition: ExceptionSvc.cpp:139
ExceptionSvc::ReturnState
ReturnState
Definition: ExceptionSvc.h:48
INamedInterface
IInterface compliant class extending IInterface with the name() method.
Definition: INamedInterface.h:15
ExceptionSvc::m_mode_exc_s
Gaudi::Property< std::string > m_mode_exc_s
Definition: ExceptionSvc.h:53
ExceptionSvc::FAILURE
Definition: ExceptionSvc.h:48
ExceptionSvc::m_retCodesErr
std::map< std::string, ReturnState > m_retCodesErr
Definition: ExceptionSvc.h:51
ExceptionSvc::DEFAULT
Definition: ExceptionSvc.h:48
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
ExceptionSvc::Policy
Policy
Definition: ExceptionSvc.h:47
ExceptionSvc::SUCCESS
Definition: ExceptionSvc.h:48
gaudirun.s
string s
Definition: gaudirun.py:316
ExceptionSvc::NONE
Definition: ExceptionSvc.h:47
ExceptionSvc::m_mode_err
Policy m_mode_err
Definition: ExceptionSvc.h:50
ExceptionSvc::process
virtual StatusCode process(const INamedInterface &o) const
Definition: ExceptionSvc.cpp:170
IExceptionSvc.h