ATLAS Offline Software
Check.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ASGMESSAGING_CHECK_H
6 #define ASGMESSAGING_CHECK_H
7 
8 // Local include(s):
10 
12 
39 #define ASG_CHECK(...) \
40  BOOST_PP_OVERLOAD(ASG_CHECK_, __VA_ARGS__)(__VA_ARGS__)
41 
42 #define ASG_CHECK_1( EXP ) \
43  do { \
44  const StatusCode sc__(EXP); \
45  if( ATH_UNLIKELY ( ! sc__.isSuccess() ) ) { \
46  ATH_MSG_ERROR( "Failed to call \"" << #EXP << "\"" ); \
47  return sc__; \
48  } \
49  } while( 0 )
50 
51 #define ASG_CHECK_2( EXP, RET ) \
52  do { \
53  const StatusCode sc__(EXP); \
54  if( ATH_UNLIKELY ( ! sc__.isSuccess() ) ) { \
55  ATH_MSG_ERROR( "Failed to call \"" << #EXP << "\"" ); \
56  return RET; \
57  } \
58  } while( 0 )
59 
69 #define ASG_CHECK_SA( SOURCE, EXP ) \
70  do { \
71  const StatusCode sc__(EXP); \
72  if( ATH_UNLIKELY ( ! sc__.isSuccess() ) ) { \
73  static MsgStream msg( SOURCE ); \
74  msg << MSGSTREAM_REPORT_PREFIX << MSG::ERROR \
75  << "Failed to call \"" << #EXP << "\"" << endmsg; \
76  return sc__; \
77  } \
78  } while( 0 )
79 
81 #ifdef XAOD_STANDALONE
82 # define ATH_CHECK ASG_CHECK
83 #else
85 #endif
86 
87 #endif // ASGMESSAGING_CHECK_H
AthCheckMacros.h
AthUnlikelyMacros.h
MsgStreamMacros.h