ATLAS Offline Software
MacroChecks.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ASSOCIATIONUTILS_MACROCHECKS_H
6 #define ASSOCIATIONUTILS_MACROCHECKS_H
7 
8 #include "AsgMessaging/Check.h"
9 
10 // Checks that pointer is non-null, prints error.
11 // Can only be used in context where the ATH_MSG_XXX macros work
12 // and where we return a StatusCode from this scope.
13 #define ORT_POINTER_CHECK( ptr ) \
14  do { \
15  if(ptr == nullptr) { \
16  ATH_MSG_ERROR(#ptr << " pointer is null!"); \
17  return StatusCode::FAILURE; \
18  } \
19  } while(0)
20 
21 #endif // ASSOCIATIONUTILS_MACROCHECKS_H
Check.h