| The Gaudi Framework v28r2p1 (f1a77ff4)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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 {
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 };
51 enum ReturnState { SUCCESS, FAILURE, RECOVERABLE, RETHROW, DEFAULT };
52
53 Policy m_mode_exc = ALL, m_mode_err = NONE;
54 std::map<std::string, ReturnState> m_retCodesExc, m_retCodesErr;
55
56 Gaudi::Property<std::string> m_mode_exc_s{this, "Catch", "ALL"};
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 // ============================================================================
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
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:314
MsgStream.h
ExceptionSvc::m_mode_err_s
Gaudi::Property< std::string > m_mode_err_s
Definition: ExceptionSvc.h:57
ExceptionSvc::ALL
Definition: ExceptionSvc.h:50
std::map< std::string, ReturnState >
ExceptionSvc::m_mode_exc
Policy m_mode_exc
Definition: ExceptionSvc.h:53
Service.h
ExceptionSvc::RETHROW
Definition: ExceptionSvc.h:51
ExceptionSvc::RECOVERABLE
Definition: ExceptionSvc.h:51
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ExceptionSvc
Simple implementation of IExceptionSvc abstract interface.
Definition: ExceptionSvc.h:19
ExceptionSvc::initialize
StatusCode initialize() override
initialize the service
Definition: ExceptionSvc.cpp:35
std::exception
STL class.
ExceptionSvc::handle
StatusCode handle(const INamedInterface &o, const GaudiException &e) const override
Handle caught GaudiExceptions.
Definition: ExceptionSvc.cpp:217
ExceptionSvc::m_retCodesExc
std::map< std::string, ReturnState > m_retCodesExc
Definition: ExceptionSvc.h:54
ExceptionSvc::ReturnState
ReturnState
Definition: ExceptionSvc.h:51
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:56
ExceptionSvc::FAILURE
Definition: ExceptionSvc.h:51
ExceptionSvc::m_retCodesErr
std::map< std::string, ReturnState > m_retCodesErr
Definition: ExceptionSvc.h:54
ExceptionSvc::DEFAULT
Definition: ExceptionSvc.h:51
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
ExceptionSvc::handleErr
StatusCode handleErr(const INamedInterface &o, const StatusCode &s) const override
Handle errors.
Definition: ExceptionSvc.cpp:144
ExceptionSvc::Policy
Policy
Definition: ExceptionSvc.h:50
ExceptionSvc::SUCCESS
Definition: ExceptionSvc.h:51
gaudirun.s
string s
Definition: gaudirun.py:245
ExceptionSvc::NONE
Definition: ExceptionSvc.h:50
ExceptionSvc::m_mode_err
Policy m_mode_err
Definition: ExceptionSvc.h:53
ExceptionSvc::process
virtual StatusCode process(const INamedInterface &o) const
Definition: ExceptionSvc.cpp:174
ExceptionSvc::~ExceptionSvc
~ExceptionSvc() override=default
Destructor.
IExceptionSvc.h