| The Gaudi Framework v27r1

- 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/Service.h"
10 #include "GaudiKernel/MsgStream.h"
11 // ============================================================================
18 // ============================================================================
19 class ExceptionSvc: public extends<Service,
20 IExceptionSvc> {
21 public:
23 StatusCode handle
24 ( const INamedInterface& o ,
25 const GaudiException& e ) const override;
26 StatusCode handle
28 ( const INamedInterface& o ,
29 const std::exception & e ) const override;
30 StatusCode handle
32 ( const INamedInterface& o ) const override;
33 StatusCode handleErr
35 ( const INamedInterface& o ,
36 const StatusCode& s ) const override;
37 public:
39 StatusCode initialize () override;
40 public:
45 ExceptionSvc
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 };
62 enum ReturnState { SUCCESS, FAILURE, RECOVERABLE, RETHROW, DEFAULT };
63
64 Policy m_mode_exc = ALL, m_mode_err = NONE;
65 StringProperty m_mode_exc_s, m_mode_err_s;
66 std::map<std::string,ReturnState> m_retCodesExc, m_retCodesErr;
67
68 mutable MsgStream m_log;
69
70 };
71
72 // ============================================================================
73 #endif // GAUDISVC_EXCEPTIONSVC_H
74 // ============================================================================
75 // The END
76 // ============================================================================
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
ExceptionSvc::ExceptionSvc
ExceptionSvc()=delete
no default constructor
ExceptionSvc::operator=
ExceptionSvc & operator=(const ExceptionSvc &)=delete
MsgStream.h
ExceptionSvc::m_retCodesErr
std::map< std::string, ReturnState > m_retCodesErr
Definition: ExceptionSvc.h:66
ExceptionSvc::handle
StatusCode handle(const INamedInterface &o, const GaudiException &e) const override
Handle caught GaudiExceptions.
Definition: ExceptionSvc.cpp:230
ExceptionSvc::ALL
Definition: ExceptionSvc.h:61
std::map< std::string, ReturnState >
ExceptionSvc::m_mode_exc
Policy m_mode_exc
Definition: ExceptionSvc.h:64
std::string
STL class.
SimpleProperty< std::string >
Service.h
ExceptionSvc::m_mode_err_s
StringProperty m_mode_err_s
Definition: ExceptionSvc.h:65
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
ExceptionSvc::RETHROW
Definition: ExceptionSvc.h:62
ExceptionSvc::RECOVERABLE
Definition: ExceptionSvc.h:62
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::m_mode_exc_s
StringProperty m_mode_exc_s
Definition: ExceptionSvc.h:65
ExceptionSvc::initialize
StatusCode initialize() override
initialize the service
Definition: ExceptionSvc.cpp:50
std::exception
STL class.
ExceptionSvc::handleErr
StatusCode handleErr(const INamedInterface &o, const StatusCode &s) const override
Handle errors.
Definition: ExceptionSvc.cpp:159
ExceptionSvc::ReturnState
ReturnState
Definition: ExceptionSvc.h:62
ExceptionSvc::m_retCodesExc
std::map< std::string, ReturnState > m_retCodesExc
Definition: ExceptionSvc.h:66
INamedInterface
IInterface compliant class extending IInterface with the name() method.
Definition: INamedInterface.h:15
ExceptionSvc::FAILURE
Definition: ExceptionSvc.h:62
ExceptionSvc::DEFAULT
Definition: ExceptionSvc.h:62
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
ExceptionSvc::Policy
Policy
Definition: ExceptionSvc.h:61
ExceptionSvc::SUCCESS
Definition: ExceptionSvc.h:62
gaudirun.s
string s
Definition: gaudirun.py:245
ExceptionSvc::NONE
Definition: ExceptionSvc.h:61
ExceptionSvc::m_mode_err
Policy m_mode_err
Definition: ExceptionSvc.h:64
ExceptionSvc::process
virtual StatusCode process(const INamedInterface &o) const
Definition: ExceptionSvc.cpp:188
ExceptionSvc::~ExceptionSvc
~ExceptionSvc() override=default
Destructor.
ExceptionSvc::m_log
MsgStream m_log
Definition: ExceptionSvc.h:68
IExceptionSvc.h