All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
RetCodeGuard.h
Go to the documentation of this file.
1 #ifndef GAUDIHIVE_RETCODEGUARD_H
2 #define GAUDIHIVE_RETCODEGUARD_H
3 
6 
9 class RetCodeGuard {
10  public:
11  inline RetCodeGuard(const SmartIF<IProperty> &appmgr, int retcode):
12  m_appmgr(appmgr), m_retcode(retcode) {}
13  inline void ignore() {
15  }
16  inline ~RetCodeGuard() {
19  }
20  }
21  private:
23  int m_retcode;
24 };
25 
26 #endif
Helper class to set the application return code in case of early exit (e.g.
Definition: RetCodeGuard.h:9
#define UNLIKELY(x)
Definition: Kernel.h:126
SmartIF< IProperty > m_appmgr
Definition: RetCodeGuard.h:22
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
Definition: AppReturnCode.h:51
RetCodeGuard(const SmartIF< IProperty > &appmgr, int retcode)
Definition: RetCodeGuard.h:11
void ignore()
Definition: RetCodeGuard.h:13
constexpr int Success
Definition: AppReturnCode.h:18