The Gaudi Framework
master (9cc87df9)
Toggle main menu visibility
Loading...
Searching...
No Matches
RetCodeGuard.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2026 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
// Framework includes
14
#include <
GaudiKernel/AppReturnCode.h
>
15
#include <
GaudiKernel/IProperty.h
>
16
#include <
GaudiKernel/SmartIF.h
>
17
20
class
RetCodeGuard
{
21
public
:
22
inline
RetCodeGuard
(
const
SmartIF<IProperty>
& appmgr,
int
retcode ) :
m_appmgr
( appmgr ),
m_retcode
( retcode ) {}
23
inline
void
ignore
() {
m_retcode
=
Gaudi::ReturnCode::Success
; }
24
inline
~RetCodeGuard
() {
25
if
(
Gaudi::ReturnCode::Success
!=
m_retcode
) {
Gaudi::setAppReturnCode
(
m_appmgr
,
m_retcode
).
ignore
(); }
26
}
27
28
private
:
29
SmartIF<IProperty>
m_appmgr
;
30
int
m_retcode
;
31
};
AppReturnCode.h
IProperty.h
SmartIF.h
RetCodeGuard::m_retcode
int m_retcode
Definition
RetCodeGuard.h:30
RetCodeGuard::RetCodeGuard
RetCodeGuard(const SmartIF< IProperty > &appmgr, int retcode)
Definition
RetCodeGuard.h:22
RetCodeGuard::~RetCodeGuard
~RetCodeGuard()
Definition
RetCodeGuard.h:24
RetCodeGuard::m_appmgr
SmartIF< IProperty > m_appmgr
Definition
RetCodeGuard.h:29
RetCodeGuard::ignore
void ignore()
Definition
RetCodeGuard.h:23
SmartIF
Small smart pointer class with automatic reference counting for IInterface.
Definition
SmartIF.h:28
StatusCode::ignore
void ignore() const
Allow discarding a StatusCode without warning.
Definition
StatusCode.h:128
Gaudi::ReturnCode::Success
constexpr int Success
Definition
AppReturnCode.h:25
Gaudi::setAppReturnCode
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
Definition
AppReturnCode.h:58
GaudiHive
src
RetCodeGuard.h
Generated on
for The Gaudi Framework by
1.18.0