The Gaudi Framework
master (ce3a6a80)
Toggle main menu visibility
Loading...
Searching...
No Matches
ExceptionSvc.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2025 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
#pragma once
12
// ============================================================================
13
// Include files
14
// ============================================================================
15
// GaudiKernel
16
// ============================================================================
17
#include <
GaudiKernel/IExceptionSvc.h
>
18
#include <
GaudiKernel/MsgStream.h
>
19
#include <
GaudiKernel/Service.h
>
20
// ============================================================================
27
// ============================================================================
28
class
ExceptionSvc
:
public
extends
<Service, IExceptionSvc> {
29
public
:
31
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
;
38
public
:
40
StatusCode
initialize
()
override
;
41
42
public
:
43
using
extends::extends;
44
45
private
:
46
// default constructor is disabled
47
ExceptionSvc
() =
delete
;
48
// copy constructor is disabled
49
ExceptionSvc
(
const
ExceptionSvc
& ) =
delete
;
50
// assignment operator is disabled
51
ExceptionSvc
&
operator=
(
const
ExceptionSvc
& ) =
delete
;
52
// process exceptions
53
virtual
StatusCode
process
(
const
INamedInterface
& o )
const
;
54
55
private
:
56
enum
Policy
{
ALL
,
NONE
};
57
enum
ReturnState
{
SUCCESS
,
FAILURE
,
RECOVERABLE
,
RETHROW
,
DEFAULT
};
58
59
Policy
m_mode_exc
=
ALL
,
m_mode_err
=
NONE
;
60
std::map<std::string, ReturnState>
m_retCodesExc
,
m_retCodesErr
;
61
62
Gaudi::Property<std::string>
m_mode_exc_s
{
this
,
"Catch"
,
"ALL"
};
63
Gaudi::Property<std::string>
m_mode_err_s
{
this
,
"Errors"
,
"NONE"
};
64
};
65
66
// ============================================================================
IExceptionSvc.h
MsgStream.h
Service.h
ExceptionSvc::m_mode_err
Policy m_mode_err
Definition
ExceptionSvc.h:59
ExceptionSvc::m_retCodesErr
std::map< std::string, ReturnState > m_retCodesErr
Definition
ExceptionSvc.h:60
ExceptionSvc::m_mode_exc
Policy m_mode_exc
Definition
ExceptionSvc.h:59
ExceptionSvc::handle
StatusCode handle(const INamedInterface &o, const GaudiException &e) const override
Handle caught GaudiExceptions.
Definition
ExceptionSvc.cpp:218
ExceptionSvc::handleErr
StatusCode handleErr(const INamedInterface &o, const StatusCode &s) const override
Handle errors.
Definition
ExceptionSvc.cpp:149
ExceptionSvc::operator=
ExceptionSvc & operator=(const ExceptionSvc &)=delete
ExceptionSvc::ExceptionSvc
ExceptionSvc()=delete
no default constructor
ExceptionSvc::m_mode_exc_s
Gaudi::Property< std::string > m_mode_exc_s
Definition
ExceptionSvc.h:62
ExceptionSvc::initialize
StatusCode initialize() override
initialize the service
Definition
ExceptionSvc.cpp:40
ExceptionSvc::m_mode_err_s
Gaudi::Property< std::string > m_mode_err_s
Definition
ExceptionSvc.h:63
ExceptionSvc::m_retCodesExc
std::map< std::string, ReturnState > m_retCodesExc
Definition
ExceptionSvc.h:60
ExceptionSvc::process
virtual StatusCode process(const INamedInterface &o) const
Definition
ExceptionSvc.cpp:180
ExceptionSvc::Policy
Policy
Definition
ExceptionSvc.h:56
ExceptionSvc::ALL
@ ALL
Definition
ExceptionSvc.h:56
ExceptionSvc::NONE
@ NONE
Definition
ExceptionSvc.h:56
ExceptionSvc::ReturnState
ReturnState
Definition
ExceptionSvc.h:57
ExceptionSvc::RETHROW
@ RETHROW
Definition
ExceptionSvc.h:57
ExceptionSvc::FAILURE
@ FAILURE
Definition
ExceptionSvc.h:57
ExceptionSvc::SUCCESS
@ SUCCESS
Definition
ExceptionSvc.h:57
ExceptionSvc::RECOVERABLE
@ RECOVERABLE
Definition
ExceptionSvc.h:57
ExceptionSvc::DEFAULT
@ DEFAULT
Definition
ExceptionSvc.h:57
ExceptionSvc::ExceptionSvc
ExceptionSvc(const ExceptionSvc &)=delete
Gaudi::Property
Implementation of property with value of concrete type.
Definition
Property.h:35
GaudiException
Define general base for Gaudi exception.
Definition
GaudiException.h:29
INamedInterface
IInterface compliant class extending IInterface with the name() method.
Definition
INamedInterface.h:23
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
extends
Base class used to extend a class implementing other interfaces.
Definition
extends.h:19
GaudiMonitor
src
ExceptionSvc.h
Generated on
for The Gaudi Framework by
1.17.0