00001 #ifndef QUICK_ANA__MESSAGE_CHECK_H
00002 #define QUICK_ANA__MESSAGE_CHECK_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <QuickAna/Global.h>
00021
00022 #include <AsgTools/MessageCheck.h>
00023
00024 namespace ana
00025 {
00026 ANA_MSG_HEADER (msgToolHandle)
00027 ANA_MSG_HEADER (msgConfiguration)
00028 ANA_MSG_HEADER (msgIsolationTools)
00029 ANA_MSG_HEADER (msgStore)
00030 ANA_MSG_HEADER (msgScheduler)
00031 ANA_MSG_HEADER (msgSelection)
00032 ANA_MSG_HEADER (msgObjectDefinition)
00033 ANA_MSG_HEADER (msgKinSelect)
00034 ANA_MSG_HEADER (msgUserCode)
00035
00036 void enableStatusCodeFailure ();
00037 }
00038
00039
00047 #define QA_CHECK_CUT(CUT,EXP) \
00048 { const auto sc__ = EXP; \
00049 typedef typename std::decay<decltype(sc__)>::type scType__; \
00050 if (::asg::CheckHelper<scType__>::isSuccess (sc__)) { \
00051 (CUT).setPassedIf (true); \
00052 } else if (::asg::CheckHelper<scType__>::isOutOfValidityRange (sc__)) { \
00053 (CUT).setFailedIf (true); \
00054 return ::asg::CheckHelper<AsgToolsCheckResultType>::successCode(); \
00055 } else { \
00056 ANA_MSG_ERROR ("Failed to call \"" << #EXP << "\""); \
00057 return ::asg::CheckHelper<AsgToolsCheckResultType>::failureCode(); \
00058 } }
00059
00072 #define QA_CHECK_WEIGHT(TYPE,WEIGHT,EXP) \
00073 { auto& weight__ = WEIGHT; \
00074 TYPE WEIGHT = 1; \
00075 const auto sc__ = EXP; \
00076 typedef typename std::decay<decltype(sc__)>::type scType__; \
00077 if (::asg::CheckHelper<scType__>::isSuccess (sc__)) { \
00078 weight__ = WEIGHT; \
00079 } else if (::asg::CheckHelper<scType__>::isOutOfValidityRange (sc__)) { \
00080 ANA_MSG_WARNING("OutOfValidityRange for: " << #EXP); \
00081 } else { \
00082 ANA_MSG_ERROR ("Failed to call \"" << #EXP << "\""); \
00083 return ::asg::CheckHelper<AsgToolsCheckResultType>::failureCode(); \
00084 } }
00085
00086 #endif