00001
00002
00003 #ifndef ASGTOOLS_CHECK_H
00004 #define ASGTOOLS_CHECK_H
00005
00006
00007 #include "AsgTools/AsgToolsConf.h"
00008 #include "AsgTools/MsgStreamMacros.h"
00009
00030 #define ASG_CHECK( EXP ) \
00031 do { \
00032 const StatusCode sc__ = EXP; \
00033 if( ! sc__.isSuccess() ) { \
00034 ATH_MSG_ERROR( "Failed to call \"" << #EXP << "\"" ); \
00035 return sc__; \
00036 } \
00037 } while( 0 )
00038
00048 #define ASG_CHECK_SA( SOURCE, EXP ) \
00049 do { \
00050 const StatusCode sc__ = EXP; \
00051 if( ! sc__.isSuccess() ) { \
00052 static MsgStream msg( SOURCE ); \
00053 msg << MSGSTREAM_REPORT_PREFIX << MSG::ERROR \
00054 << "Failed to call \"" << #EXP << "\"" << endmsg; \
00055 return sc__; \
00056 } \
00057 } while( 0 )
00058
00060 #ifdef ASGTOOL_STANDALONE
00061 # define ATH_CHECK( EXP ) ASG_CHECK( EXP )
00062 #endif
00063
00064 #endif // ASGTOOLS_CHECK_H