| The Gaudi Framework v29r0 (ff2e7097)

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

- File List
- File Members

RetCodeGuard.h
Go to the documentation of this file.
1 #ifndef GAUDIHIVE_RETCODEGUARD_H
2 #define GAUDIHIVE_RETCODEGUARD_H
3
4 #include "GaudiKernel/AppReturnCode.h"
5 #include "GaudiKernel/IProperty.h"
6
9 class RetCodeGuard
10 {
11 public:
12 inline RetCodeGuard( const SmartIF<IProperty>& appmgr, int retcode ) : m_appmgr( appmgr ), m_retcode( retcode ) {}
13 inline void ignore() { m_retcode = Gaudi::ReturnCode::Success; }
14 inline ~RetCodeGuard()
15 {
16 if ( UNLIKELY( Gaudi::ReturnCode::Success != m_retcode ) ) {
17 Gaudi::setAppReturnCode( m_appmgr, m_retcode );
18 }
19 }
20
21 private:
22 SmartIF<IProperty> m_appmgr;
23 int m_retcode;
24 };
25
26 #endif
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:128
SmartIF< IProperty >
RetCodeGuard
Helper class to set the application return code in case of early exit (e.g.
Definition: RetCodeGuard.h:9
RetCodeGuard::~RetCodeGuard
~RetCodeGuard()
Definition: RetCodeGuard.h:14
gaudirun.retcode
retcode
Definition: gaudirun.py:499
RetCodeGuard::m_retcode
int m_retcode
Definition: RetCodeGuard.h:23
RetCodeGuard::m_appmgr
SmartIF< IProperty > m_appmgr
Definition: RetCodeGuard.h:22
Gaudi::setAppReturnCode
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
Definition: AppReturnCode.h:51
AppReturnCode.h
IProperty.h
RetCodeGuard::RetCodeGuard
RetCodeGuard(const SmartIF< IProperty > &appmgr, int retcode)
Definition: RetCodeGuard.h:12
RetCodeGuard::ignore
void ignore()
Definition: RetCodeGuard.h:13
Gaudi::ReturnCode::Success
constexpr int Success
Definition: AppReturnCode.h:18