MeVisLab Toolbox Reference
mlErrorMacros.h File Reference
#include <utility>
#include <type_traits>
#include "mlConfig.h"
#include "mlMacros.h"
#include "mlLogging.h"

Go to the source code of this file.

Macros

Try/Catch macros

Macro interface to the ML error handler for tracing and error handling of ML code, alternatively it can redirect to Syngo tracing/error handling.

mba: We do not use these macros anymore at MMS, they are only kept for compatibility of external code.

#define ML_TRY   try
 
#define ML_CATCH   catch(...){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_UNKNOWN_EXCEPTION); }
 
#define ML_CATCH_RETURN   catch(...){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_UNKNOWN_EXCEPTION); return; }
 
#define ML_CATCH_RETURN_FALSE   catch(...){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_UNKNOWN_EXCEPTION); return false; }
 
#define ML_CATCH_RETURN_NULL   catch(...){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_UNKNOWN_EXCEPTION); return 0; }
 
#define ML_CATCH_RETHROW   catch(...){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_UNKNOWN_EXCEPTION); throw; }
 
#define ML_CATCH_BLOCK(__paramType)   catch(__paramType)
 
Check macros
#define ML_CHECK(x)   if (!(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); }
 
#define ML_CHECK_ONLY_IN_DEBUG(x)   /* Behaves like assert, not compiled in release mode */
 
#define ML_CHECK_RETURN(x)   if (!(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); return; }
 
#define ML_CHECK_RETURN_FALSE(x)   if (!(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); return false; }
 
#define ML_CHECK_RETURN_NULL(x)   if (!(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); return 0; }
 
#define ML_CHECK_THROW(x)   if (!(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); throw ML_BAD_POINTER_OR_0; }
 
#define ML_CHECK_RUNTIME_TYPE(x)   if (!(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_TYPE_NOT_REGISTERED); throw ML_TYPE_NOT_REGISTERED; }
 
#define ML_HARAKIRI   MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0);
 This logs the fatal error with file and line number. More...
 
Warn free check macros for floating point (but also integer) values. Requires mlUtilsTraits.h.
#define ML_CHECK_FLOAT(x)   if (MLValueIs0WOM(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); }
 
#define ML_CHECK_FLOAT_RETURN(x)   if (MLValueIs0WOM(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); return; }
 
#define ML_CHECK_FLOAT_RETURN_FALSE(x)   if (MLValueIs0WOM(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); return false; }
 
#define ML_CHECK_FLOAT_RETURN_NULL(x)   if (MLValueIs0WOM(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); return 0; }
 
#define ML_CHECK_FLOAT_THROW(x)   if (MLValueIs0WOM(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); throw ML_BAD_POINTER_OR_0; }
 
#define ML_CHECK_FLOAT_RUNTIME_TYPE(x)   if (MLValueIs0WOM(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_TYPE_NOT_REGISTERED); throw ML_TYPE_NOT_REGISTERED; }
 
Empty private add on macros used by other error handling contexts. Not used by MeVis.
#define _ML_INFORMATION_ADD_ON(FUNC_NAME, REASON, HANDLING)
 Private additional macro which is compiled in ML_PRINT_INFORMATION macros. More...
 
#define _ML_WARNING_ADD_ON(FUNC_NAME, REASON, HANDLING)
 Private additional macro which is compiled in ML_PRINT_WARNING macros. More...
 
#define _ML_ERROR_ADD_ON(FUNC_NAME, REASON, HANDLING)
 Private additional macro which is compiled in ML_PRINT_ERROR output macros. More...
 
#define _ML_FATAL_ERROR_ADD_ON(FUNC_NAME, REASON, HANDLING)
 Private additional macro which is compiled in ML_PRINT_FATAL_ERROR output macros. More...
 
#define _ML_ERROR_SHOW_ASSERT_BOX(PARAM)
 Private additional macro which is used to print assert boxes on e.g., (fatal) errors. More...
 
HIDDEN MACROS TO HANDLE (FATAL) ERRORS, WARNINGS, INFORMATION AND TRACE LOG MESSAGES.
#define _ML_PRINT_FATAL_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, RTYPE)
 Macro to send a fatal error message to the error output system of the ML. More...
 
#define _ML_PRINT_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, RTYPE)
 Macro to send an error message to the error output system of the ML. More...
 
#define _ML_PRINT_WARNING_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, RTYPE)
 Macro to send a warning message to the error output system of the ML. More...
 
#define _ML_PRINT_INFORMATION_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, RTYPE)
 Macro to send an information message to the error output system of the ML. More...
 
ML ERROR MACROS WHICH ALSO DUMP RUNTIME OBJECT INFORMATION.
#define ML_PRINT_FATAL_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ)
 Like _ML_PRINT_FATAL_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, RTYPE) with RT_OBJ as parameter which will be dumped in the error case. More...
 
#define ML_PRINT_FATAL_ERROR_DUMP_NON_NULL(FUNC_NAME, REASON, HANDLING, RT_OBJ)    _ML_PRINT_FATAL_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, (RT_OBJ)->getTypeId())
 Like _ML_PRINT_FATAL_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, RTYPE) with non-null RT_OBJ as parameter which will be dumped in the error case. More...
 
#define ML_PRINT_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ)
 Like _ML_PRINT_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, RTYPE) with RT_OBJ as parameter which will be dumped in the error case. More...
 
#define ML_PRINT_ERROR_DUMP_NON_NULL(FUNC_NAME, REASON, HANDLING, RT_OBJ)    _ML_PRINT_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, (RT_OBJ)->getTypeId())
 Like _ML_PRINT_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, RTYPE) with non-null RT_OBJ as parameter which will be dumped in the error case. More...
 
#define ML_PRINT_WARNING_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ)
 Like _ML_PRINT_WARNING_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, RTYPE) with RT_OBJ as parameter which will be dumped in the error case. More...
 
#define ML_PRINT_INFORMATION_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ)
 Like _ML_PRINT_INFORMATION_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, RTYPE) with RT_OBJ as parameter which will be dumped in the error case. More...
 
Public macros to handle (fatal) errors, warnings, information and trace log information.
#define ML_PRINT_FATAL_ERROR(FUNC_NAME, REASON, HANDLING)    _ML_PRINT_FATAL_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, nullptr, nullptr)
 Like ML_PRINT_FATAL_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ) without a runtime object to be dumped. More...
 
#define ML_PRINT_ERROR(FUNC_NAME, REASON, HANDLING)    _ML_PRINT_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, nullptr, nullptr)
 Like ML_PRINT_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ) without a runtime object to be dumped. More...
 
#define ML_PRINT_WARNING(FUNC_NAME, REASON, HANDLING)    _ML_PRINT_WARNING_DUMP(FUNC_NAME, REASON, HANDLING, nullptr, nullptr)
 Like ML_PRINT_WARNING_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ) without a runtime object to be dumped. More...
 
#define ML_PRINT_INFORMATION(FUNC_NAME, REASON, HANDLING)    _ML_PRINT_INFORMATION_DUMP(FUNC_NAME, REASON, HANDLING, nullptr, nullptr)
 Like ML_PRINT_INFORMATION_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ) without a runtime object to be dumped. More...
 
#define ML_PRINT_INFO(FUNC_NAME, HANDLING)    _ML_PRINT_INFORMATION_DUMP(FUNC_NAME, ML_RESULT_OK, HANDLING, nullptr, nullptr)
 Convenience version of ML_PRINT_INFORMATION(FUNC_NAME, REASON, HANDLING) with REASON = ML_RESULT_OK. More...
 

Macro Definition Documentation

◆ _ML_ERROR_ADD_ON

#define _ML_ERROR_ADD_ON (   FUNC_NAME,
  REASON,
  HANDLING 
)

Private additional macro which is compiled in ML_PRINT_ERROR output macros.

It can be used to add additional error log code to the default error output macros. In the standard MeVis case we compile it empty. NOT TO BE USED DIRECTLY BY APPLICATION/USER CODE!

Definition at line 266 of file mlErrorMacros.h.

◆ _ML_ERROR_SHOW_ASSERT_BOX

#define _ML_ERROR_SHOW_ASSERT_BOX (   PARAM)

Private additional macro which is used to print assert boxes on e.g., (fatal) errors.

It is added to the end of ML_PRINT_ERROR and ML_PRINT_FATAL_ERROR macros. In the standard MeVis case we compile it empty, some other error handling contexts may compile pop up windows etc. into it to terminate on (fatal) errors. NOT TO BE USED DIRECTLY BY APPLICATION/USER CODE!

Definition at line 279 of file mlErrorMacros.h.

◆ _ML_FATAL_ERROR_ADD_ON

#define _ML_FATAL_ERROR_ADD_ON (   FUNC_NAME,
  REASON,
  HANDLING 
)

Private additional macro which is compiled in ML_PRINT_FATAL_ERROR output macros.

It can be used to add additional error log code to the default fatal error output macros. In the standard MeVis case we compile it empty. NOT TO BE USED DIRECTLY BY APPLICATION/USER CODE!

Definition at line 272 of file mlErrorMacros.h.

◆ _ML_INFORMATION_ADD_ON

#define _ML_INFORMATION_ADD_ON (   FUNC_NAME,
  REASON,
  HANDLING 
)

Private additional macro which is compiled in ML_PRINT_INFORMATION macros.

It can be used to add additional information log code to the default information output macros. In the standard MeVis case we compile it empty. NOT TO BE USED DIRECTLY BY APPLICATION/USER CODE!

Definition at line 254 of file mlErrorMacros.h.

◆ _ML_PRINT_ERROR_DUMP

#define _ML_PRINT_ERROR_DUMP (   FUNC_NAME,
  REASON,
  HANDLING,
  RT_OBJ,
  RTYPE 
)
Value:
{ \
/* Get runtime information from RTYPE which could be a crashing expression.*/ \
const ML_UTILS_NAMESPACE::RuntimeType *rtt1987 = nullptr; \
try{ rtt1987 = RTYPE; if (MLAlwaysFalse){ throw ML_UNKNOWN_EXCEPTION;} } catch(...){ rtt1987 = nullptr; }\
_ML_ERROR_ADD_ON(FUNC_NAME, REASON, HANDLING) \
ML_PREFIX, "Function=", FUNC_NAME, REASON, HANDLING, \
__FILE__, __LINE__, RT_OBJ, rtt1987); \
_ML_ERROR_SHOW_ASSERT_BOX(0); \
}
#define ML_PREFIX
Library identification prefix for messages from the ML.
Definition: mlTypeDefs.h:86
#define ML_UNKNOWN_EXCEPTION
An unknown exception was detected and caught; this usually means that something for an unknown reason...
Definition: mlTypeDefs.h:832
void printAndNotify(MLMessageType messageType, const std::string &libraryPrefix, const std::string &fPrefix, const std::string &functionName, const std::string &reason, const std::string &handling="", const std::string &file="", int line=-1, const void *dumpObj=nullptr, const RuntimeType *dumpObjRT=nullptr, MLErrorCode errCode=ML_RESULT_OK) const
Core error printing function used by all other functions.
@ ML_ERROR
Definition: mlTypeDefs.h:799
ML_UTILS_EXPORT int MLAlwaysFalse
Variable which is always false (=0), but non constant to make it impossible for compilers to detect t...
ML_UTILS_EXPORT ErrorOutput MLErrorOutput
This is a singleton used for all ML Error input and output;.

Macro to send an error message to the error output system of the ML.

Should be used whenever a error is detected which can be handled to notify the ML and appended error handlers. This macro is intended for ML internal use. Please use ML_PRINT_ERROR normally.

Parameters
FUNC_NAMEis a string describing the error position, typically ClassName::MethodName.
REASONshould be an MLErrorCode describing the error type.
HANDLINGis a string describing what the program does to handle the error, e.g., returning from the method or switching to another mode.
RT_OBJis a pointer to a runtime typed object causing this error. If a dump function is registered in the ML C-API it will be dumped. If NULL it will be ignored.
RTYPEis the runtime type of RTYPE or NULL. If NULL it will be ignored.

Definition at line 333 of file mlErrorMacros.h.

◆ _ML_PRINT_FATAL_ERROR_DUMP

#define _ML_PRINT_FATAL_ERROR_DUMP (   FUNC_NAME,
  REASON,
  HANDLING,
  RT_OBJ,
  RTYPE 
)
Value:
{ \
/* Get runtime information from RTYPE which could be a crashing expression.*/ \
const ML_UTILS_NAMESPACE::RuntimeType *rtt7645 = nullptr; \
try{ rtt7645 = RTYPE; if (MLAlwaysFalse){ throw ML_UNKNOWN_EXCEPTION;} } catch(...){ rtt7645 = nullptr; }\
_ML_FATAL_ERROR_ADD_ON(FUNC_NAME, REASON, HANDLING) \
ML_PREFIX, "Function=", FUNC_NAME, REASON, HANDLING, \
__FILE__, __LINE__, RT_OBJ, rtt7645); \
_ML_ERROR_SHOW_ASSERT_BOX(0); \
}
@ ML_FATAL
Definition: mlTypeDefs.h:800

Macro to send a fatal error message to the error output system of the ML.

Should be used whenever a fatal error is detected to notify the ML and appended error handlers. This macro is intended for ML internal use. Please use ML_PRINT_FATAL_ERROR normally.

Parameters
FUNC_NAMEis a string describing the error position, typically ClassName::MethodName.
REASONshould be an MLErrorCode describing the error type.
HANDLINGis a string describing what the program does to handle the error (if possible), e.g., returning from the method.
RT_OBJis a pointer to a runtime typed object causing this error. If a dump function is registered in the ML C-API it will be dumped. If NULL it will be ignored.
RTYPEis the runtime type of RTYPE or NULL. If NULL it will be ignored.

Definition at line 307 of file mlErrorMacros.h.

◆ _ML_PRINT_INFORMATION_DUMP

#define _ML_PRINT_INFORMATION_DUMP (   FUNC_NAME,
  REASON,
  HANDLING,
  RT_OBJ,
  RTYPE 
)
Value:
{ \
/* Get runtime information from RTYPE which could be a crashing expression.*/ \
const ML_UTILS_NAMESPACE::RuntimeType *rtAx598 = nullptr; \
try{ rtAx598 = RTYPE; if (MLAlwaysFalse){ throw ML_UNKNOWN_EXCEPTION;} } catch(...){ rtAx598 = nullptr; }\
_ML_INFORMATION_ADD_ON(FUNC_NAME, REASON, HANDLING) \
ML_PREFIX, "Function=", FUNC_NAME, REASON, HANDLING, \
__FILE__, __LINE__, RT_OBJ, rtAx598); \
/* No showing of assert box here. That would be to drastic. */ \
}
@ ML_INFORMATION
Definition: mlTypeDefs.h:804

Macro to send an information message to the error output system of the ML.

Should be used whenever a basic system information must be sent to the application log or error management system. It is not intended as a debugging output; use mlDebug macros for that. This macro is intended for ML internal use. Please use ML_PRINT_INFORMATION normally.

Parameters
FUNC_NAMEis a string describing the code position, typically ClassName::MethodName.
REASONshould be an MLErrorCode describing the information or error type.
HANDLINGis a string describing what the program does to handle the message, e.g., returning from the method or switching to another mode.
RT_OBJis a pointer to a runtime typed object causing this information. If a dump function is registered in the ML C-API it will be dumped. If nullptr it will be ignored.
RTYPEis the runtime type of RTYPE or nullptr. If nullptr it will be ignored.

Definition at line 387 of file mlErrorMacros.h.

◆ _ML_PRINT_WARNING_DUMP

#define _ML_PRINT_WARNING_DUMP (   FUNC_NAME,
  REASON,
  HANDLING,
  RT_OBJ,
  RTYPE 
)
Value:
{ \
/* Get runtime information from RTYPE which could be a crashing expression.*/ \
const ML_UTILS_NAMESPACE::RuntimeType *rt9477 = nullptr; \
try{ rt9477 = RTYPE; if (MLAlwaysFalse){ throw ML_UNKNOWN_EXCEPTION;} } catch(...){ rt9477 = nullptr; } \
_ML_WARNING_ADD_ON(FUNC_NAME, REASON, HANDLING) \
ML_PREFIX, "Function=", FUNC_NAME, REASON, HANDLING, \
__FILE__, __LINE__, RT_OBJ, rt9477); \
/* No showing of assert box here. That would be to drastic. */ \
}
@ ML_WARNING
Definition: mlTypeDefs.h:798

Macro to send a warning message to the error output system of the ML.

Should be used whenever an inadequate situation is detected which is not really problematic but which should be notified or handled. So the ML and appended error handlers are notified correctly. This macro is intended for ML internal use. Please use ML_PRINT_WARNING normally.

Parameters
FUNC_NAMEis a string describing the error position, typically ClassName::MethodName.
REASONshould be an MLErrorCode describing the warning/error type.
HANDLINGis a string describing what the program does to handle the reason of the warning, e.g., returning from the method or switching to another mode.
RT_OBJis a pointer to a runtime typed object causing this warning. If a dump function is registered in the ML C-API it will be dumped. If nullptr it will be ignored.
RTYPEis the runtime type of RTYPE or nullptr. If nullptr it will be ignored.

Definition at line 360 of file mlErrorMacros.h.

◆ _ML_WARNING_ADD_ON

#define _ML_WARNING_ADD_ON (   FUNC_NAME,
  REASON,
  HANDLING 
)

Private additional macro which is compiled in ML_PRINT_WARNING macros.

It can be used to add additional warning log code to the default warn output macros. In the standard MeVis case we compile it empty. NOT TO BE USED DIRECTLY BY APPLICATION/USER CODE!

Definition at line 260 of file mlErrorMacros.h.

◆ ML_CATCH

#define ML_CATCH   catch(...){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_UNKNOWN_EXCEPTION); }

Definition at line 87 of file mlErrorMacros.h.

◆ ML_CATCH_BLOCK

#define ML_CATCH_BLOCK (   __paramType)    catch(__paramType)

Definition at line 92 of file mlErrorMacros.h.

◆ ML_CATCH_RETHROW

#define ML_CATCH_RETHROW   catch(...){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_UNKNOWN_EXCEPTION); throw; }

Definition at line 91 of file mlErrorMacros.h.

◆ ML_CATCH_RETURN

#define ML_CATCH_RETURN   catch(...){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_UNKNOWN_EXCEPTION); return; }

Definition at line 88 of file mlErrorMacros.h.

◆ ML_CATCH_RETURN_FALSE

#define ML_CATCH_RETURN_FALSE   catch(...){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_UNKNOWN_EXCEPTION); return false; }

Definition at line 89 of file mlErrorMacros.h.

◆ ML_CATCH_RETURN_NULL

#define ML_CATCH_RETURN_NULL   catch(...){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_UNKNOWN_EXCEPTION); return 0; }

Definition at line 90 of file mlErrorMacros.h.

◆ ML_CHECK

#define ML_CHECK (   x)    if (!(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); }

Definition at line 121 of file mlErrorMacros.h.

◆ ML_CHECK_FLOAT

#define ML_CHECK_FLOAT (   x)    if (MLValueIs0WOM(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); }

Definition at line 164 of file mlErrorMacros.h.

◆ ML_CHECK_FLOAT_RETURN

#define ML_CHECK_FLOAT_RETURN (   x)    if (MLValueIs0WOM(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); return; }

Definition at line 165 of file mlErrorMacros.h.

◆ ML_CHECK_FLOAT_RETURN_FALSE

#define ML_CHECK_FLOAT_RETURN_FALSE (   x)    if (MLValueIs0WOM(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); return false; }

Definition at line 166 of file mlErrorMacros.h.

◆ ML_CHECK_FLOAT_RETURN_NULL

#define ML_CHECK_FLOAT_RETURN_NULL (   x)    if (MLValueIs0WOM(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); return 0; }

Definition at line 167 of file mlErrorMacros.h.

◆ ML_CHECK_FLOAT_RUNTIME_TYPE

#define ML_CHECK_FLOAT_RUNTIME_TYPE (   x)    if (MLValueIs0WOM(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_TYPE_NOT_REGISTERED); throw ML_TYPE_NOT_REGISTERED; }

Definition at line 169 of file mlErrorMacros.h.

◆ ML_CHECK_FLOAT_THROW

#define ML_CHECK_FLOAT_THROW (   x)    if (MLValueIs0WOM(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); throw ML_BAD_POINTER_OR_0; }

Definition at line 168 of file mlErrorMacros.h.

◆ ML_CHECK_ONLY_IN_DEBUG

#define ML_CHECK_ONLY_IN_DEBUG (   x)    /* Behaves like assert, not compiled in release mode */

Definition at line 125 of file mlErrorMacros.h.

◆ ML_CHECK_RETURN

#define ML_CHECK_RETURN (   x)    if (!(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); return; }

Definition at line 127 of file mlErrorMacros.h.

◆ ML_CHECK_RETURN_FALSE

#define ML_CHECK_RETURN_FALSE (   x)    if (!(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); return false; }

Definition at line 128 of file mlErrorMacros.h.

◆ ML_CHECK_RETURN_NULL

#define ML_CHECK_RETURN_NULL (   x)    if (!(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); return 0; }

Definition at line 129 of file mlErrorMacros.h.

◆ ML_CHECK_RUNTIME_TYPE

#define ML_CHECK_RUNTIME_TYPE (   x)    if (!(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_TYPE_NOT_REGISTERED); throw ML_TYPE_NOT_REGISTERED; }

Definition at line 131 of file mlErrorMacros.h.

◆ ML_CHECK_THROW

#define ML_CHECK_THROW (   x)    if (!(x)){ MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0); throw ML_BAD_POINTER_OR_0; }

Definition at line 130 of file mlErrorMacros.h.

◆ ML_HARAKIRI

#define ML_HARAKIRI   MLPrintAndNotifyFatal(__FILE__, __LINE__, ML_BAD_POINTER_OR_0);

This logs the fatal error with file and line number.

Definition at line 134 of file mlErrorMacros.h.

◆ ML_PRINT_ERROR_DUMP

#define ML_PRINT_ERROR_DUMP (   FUNC_NAME,
  REASON,
  HANDLING,
  RT_OBJ 
)
Value:
/* Use OR with MLAlwaysFalse to avoid compiler warnings about unreachable code when constant RT_OBJ is passed from other macro. */ \
_ML_PRINT_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, (((RT_OBJ) || MLAlwaysFalse) ? (RT_OBJ)->getTypeId() : nullptr))

Like _ML_PRINT_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, RTYPE) with RT_OBJ as parameter which will be dumped in the error case.

Definition at line 427 of file mlErrorMacros.h.

◆ ML_PRINT_ERROR_DUMP_NON_NULL

#define ML_PRINT_ERROR_DUMP_NON_NULL (   FUNC_NAME,
  REASON,
  HANDLING,
  RT_OBJ 
)     _ML_PRINT_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, (RT_OBJ)->getTypeId())

Like _ML_PRINT_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, RTYPE) with non-null RT_OBJ as parameter which will be dumped in the error case.

Definition at line 435 of file mlErrorMacros.h.

◆ ML_PRINT_FATAL_ERROR_DUMP

#define ML_PRINT_FATAL_ERROR_DUMP (   FUNC_NAME,
  REASON,
  HANDLING,
  RT_OBJ 
)
Value:
/* Use OR with MLAlwaysFalse to avoid compiler warnings about unreachable code when constant RT_OBJ is passed from other macro. */ \
_ML_PRINT_FATAL_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, (((RT_OBJ) || MLAlwaysFalse) ? (RT_OBJ)->getTypeId() : nullptr))

Like _ML_PRINT_FATAL_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, RTYPE) with RT_OBJ as parameter which will be dumped in the error case.

Definition at line 412 of file mlErrorMacros.h.

◆ ML_PRINT_FATAL_ERROR_DUMP_NON_NULL

#define ML_PRINT_FATAL_ERROR_DUMP_NON_NULL (   FUNC_NAME,
  REASON,
  HANDLING,
  RT_OBJ 
)     _ML_PRINT_FATAL_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, (RT_OBJ)->getTypeId())

Like _ML_PRINT_FATAL_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, RTYPE) with non-null RT_OBJ as parameter which will be dumped in the error case.

Definition at line 420 of file mlErrorMacros.h.

◆ ML_PRINT_INFORMATION_DUMP

#define ML_PRINT_INFORMATION_DUMP (   FUNC_NAME,
  REASON,
  HANDLING,
  RT_OBJ 
)
Value:
/* Use OR with MLAlwaysFalse to avoid compiler warnings about unreachable code when constant RT_OBJ is passed from other macro. */ \
_ML_PRINT_INFORMATION_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, (((RT_OBJ) || MLAlwaysFalse) ? (RT_OBJ)->getTypeId() : nullptr))

Like _ML_PRINT_INFORMATION_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, RTYPE) with RT_OBJ as parameter which will be dumped in the error case.

Definition at line 450 of file mlErrorMacros.h.

◆ ML_PRINT_WARNING_DUMP

#define ML_PRINT_WARNING_DUMP (   FUNC_NAME,
  REASON,
  HANDLING,
  RT_OBJ 
)
Value:
/* Use OR with MLAlwaysFalse to avoid compiler warnings about unreachable code when constant RT_OBJ is passed from other macro. */ \
_ML_PRINT_WARNING_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, (((RT_OBJ) || MLAlwaysFalse) ? (RT_OBJ)->getTypeId() : nullptr))

Like _ML_PRINT_WARNING_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ, RTYPE) with RT_OBJ as parameter which will be dumped in the error case.

Definition at line 442 of file mlErrorMacros.h.

◆ ML_TRY

#define ML_TRY   try

Definition at line 86 of file mlErrorMacros.h.