00001
00002 #ifndef XAODROOTACCESS_TOOLS_RETURNCHECK_H
00003 #define XAODROOTACCESS_TOOLS_RETURNCHECK_H
00004
00005
00006 #include <TError.h>
00007
00008
00009 #include "xAODRootAccess/tools/TReturnCode.h"
00010 #include "xAODRootAccess/tools/Message.h"
00011
00021 #define RETURN_CHECK( CONTEXT, EXP ) \
00022 do { \
00023 const auto result = EXP; \
00024 if( ! result.isSuccess() ) { \
00025 ::Error( CONTEXT, XAOD_MESSAGE( "Failed to execute: %s" ), \
00026 #EXP ); \
00027 return result; \
00028 } \
00029 } while( false )
00030
00031 #endif // XAODROOTACCESS_TOOLS_RETURNCHECK_H