00001 #ifndef ASSOCIATIONUTILS_MACROCHECKS_H 00002 #define ASSOCIATIONUTILS_MACROCHECKS_H 00003 00004 #include "AsgTools/Check.h" 00005 00006 // Checks that pointer is non-null, prints error. 00007 // Can only be used in context where the ATH_MSG_XXX macros work 00008 // and where we return a StatusCode from this scope. 00009 #define ORT_POINTER_CHECK( ptr ) \ 00010 do { \ 00011 if(ptr == nullptr) { \ 00012 ATH_MSG_ERROR(#ptr << " pointer is null!"); \ 00013 return StatusCode::FAILURE; \ 00014 } \ 00015 } while(0) 00016 00017 #endif // ASSOCIATIONUTILS_MACROCHECKS_H