The Gaudi Framework  v33r0 (d5ea422b)
ExceptionSvc.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDISVC_EXCEPTIONSVC_H
12 #define GAUDISVC_EXCEPTIONSVC_H
13 // ============================================================================
14 // Include files
15 // ============================================================================
16 // GaudiKernel
17 // ============================================================================
19 #include "GaudiKernel/MsgStream.h"
20 #include "GaudiKernel/Service.h"
21 // ============================================================================
28 // ============================================================================
29 class ExceptionSvc : public extends<Service, IExceptionSvc> {
30 public:
32  StatusCode handle( const INamedInterface& o, const GaudiException& e ) const override;
33  StatusCode handle( const INamedInterface& o, const std::exception& e ) const override;
35  StatusCode handle( const INamedInterface& o ) const override;
37  StatusCode handleErr( const INamedInterface& o, const StatusCode& s ) const override;
39 public:
41  StatusCode initialize() override;
42 
43 public:
44  using extends::extends;
45 
46 private:
47  // default constructor is disabled
48  ExceptionSvc() = delete;
49  // copy constructor is disabled
50  ExceptionSvc( const ExceptionSvc& ) = delete;
51  // assignment operator is disabled
52  ExceptionSvc& operator=( const ExceptionSvc& ) = delete;
53  // process exceptions
54  virtual StatusCode process( const INamedInterface& o ) const;
55 
56 private:
57  enum Policy { ALL, NONE };
59 
62 
64  Gaudi::Property<std::string> m_mode_err_s{this, "Errors", "NONE"};
65 };
66 
67 // ============================================================================
68 #endif // GAUDISVC_EXCEPTIONSVC_H
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:370
StatusCode handle(const INamedInterface &o, const GaudiException &e) const override
Handle caught GaudiExceptions.
Gaudi::Property< std::string > m_mode_err_s
Definition: ExceptionSvc.h:64
Policy m_mode_exc
Definition: ExceptionSvc.h:60
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
Simple implementation of IExceptionSvc abstract interface.
Definition: ExceptionSvc.h:29
StatusCode initialize() override
initialize the service
STL class.
std::map< std::string, ReturnState > m_retCodesExc
Definition: ExceptionSvc.h:61
StatusCode handleErr(const INamedInterface &o, const StatusCode &s) const override
Handle errors.
IInterface compliant class extending IInterface with the name() method.
Gaudi::Property< std::string > m_mode_exc_s
Definition: ExceptionSvc.h:63
std::map< std::string, ReturnState > m_retCodesErr
Definition: ExceptionSvc.h:61
Base class used to extend a class implementing other interfaces.
Definition: extends.h:20
string s
Definition: gaudirun.py:328
Policy m_mode_err
Definition: ExceptionSvc.h:60
virtual StatusCode process(const INamedInterface &o) const