ATLAS Offline Software
Macros
ReturnCheck.h File Reference
#include <TError.h>
#include "AsgMessaging/StatusCode.h"
#include "xAODRootAccess/tools/Message.h"
Include dependency graph for ReturnCheck.h:

Go to the source code of this file.

Macros

#define RETURN_CHECK(CONTEXT, EXP)
 Helper macro for checking return codes in a compact form in the code. More...
 

Macro Definition Documentation

◆ RETURN_CHECK

#define RETURN_CHECK (   CONTEXT,
  EXP 
)
Value:
do { \
const auto result = EXP; \
if( ! result.isSuccess() ) { \
::Error( CONTEXT, XAOD_MESSAGE( "Failed to execute: %s" ), \
#EXP ); \
return result; \
} \
} while( false )

Helper macro for checking return codes in a compact form in the code.

This is pretty much a rip-off of the (ATH_)CHECK macros of the offline code. It is used in the package in functions that return a StatusCode, and themselves call functions returning StatusCode.

Parameters
CONTEXTA context string to print an error message on failure
EXPThe expression to execute in a checked manner

Definition at line 27 of file ReturnCheck.h.

get_generator_info.result
result
Definition: get_generator_info.py:21
XAOD_MESSAGE
#define XAOD_MESSAGE(MESSAGE)
Simple macro for printing error/verbose messages.
Definition: Control/xAODRootAccess/xAODRootAccess/tools/Message.h:19
L1Topo::Error
Error
The different types of error that can be flagged in the L1TopoRDO.
Definition: Error.h:16