ML 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.
 
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.
 
#define _ML_WARNING_ADD_ON(FUNC_NAME, REASON, HANDLING)
 Private additional macro which is compiled in ML_PRINT_WARNING macros.
 
#define _ML_ERROR_ADD_ON(FUNC_NAME, REASON, HANDLING)
 Private additional macro which is compiled in ML_PRINT_ERROR output macros.
 
#define _ML_FATAL_ERROR_ADD_ON(FUNC_NAME, REASON, HANDLING)
 Private additional macro which is compiled in ML_PRINT_FATAL_ERROR output macros.
 
#define _ML_ERROR_SHOW_ASSERT_BOX(PARAM)
 Private additional macro which is used to print assert boxes on e.g., (fatal) errors.
 
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.
 
#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.
 
#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.
 
#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.
 
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.
 
#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.
 
#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.
 
#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.
 
#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.
 
#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.
 
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.
 
#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.
 
#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.
 
#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.
 
#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.
 

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 132 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 145 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 138 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 120 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_UTILS_NAMESPACE::MLErrorOutput.printAndNotify(ML_ERROR, \
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:80
#define ML_UNKNOWN_EXCEPTION
An unknown exception was detected and caught; this usually means that something for an unknown reason...
Definition mlTypeDefs.h:730
@ ML_ERROR
Definition mlTypeDefs.h:697
ML_UTILS_EXPORT int MLAlwaysFalse
Variable which is always false (=0), but non constant to make it impossible for compilers to detect t...

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 199 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_UTILS_NAMESPACE::MLErrorOutput.printAndNotify(ML_FATAL, \
ML_PREFIX, "Function=", FUNC_NAME, REASON, HANDLING, \
__FILE__, __LINE__, RT_OBJ, rtt7645); \
_ML_ERROR_SHOW_ASSERT_BOX(0); \
}
@ ML_FATAL
Definition mlTypeDefs.h:698

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 173 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_UTILS_NAMESPACE::MLErrorOutput.printAndNotify(ML_INFORMATION, \
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:702

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 253 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_UTILS_NAMESPACE::MLErrorOutput.printAndNotify(ML_WARNING, \
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:696

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 226 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 126 of file mlErrorMacros.h.

◆ ML_CATCH

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

Definition at line 65 of file mlErrorMacros.h.

◆ ML_CATCH_BLOCK

#define ML_CATCH_BLOCK ( __paramType)    catch(__paramType)

Definition at line 70 of file mlErrorMacros.h.

◆ ML_CATCH_RETHROW

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

Definition at line 69 of file mlErrorMacros.h.

◆ ML_CATCH_RETURN

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

Definition at line 66 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 67 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 68 of file mlErrorMacros.h.

◆ ML_CHECK

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

Definition at line 80 of file mlErrorMacros.h.

◆ ML_CHECK_FLOAT

◆ 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 103 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 104 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 105 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 107 of file mlErrorMacros.h.

◆ ML_CHECK_FLOAT_THROW

◆ ML_CHECK_ONLY_IN_DEBUG

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

Definition at line 84 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 86 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 87 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 88 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 90 of file mlErrorMacros.h.

◆ ML_CHECK_THROW

◆ 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 93 of file mlErrorMacros.h.

Referenced by ml::MLTStdTypeInfos< VTYP >::MLTStdTypeInfos().

◆ 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 293 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 301 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 278 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 286 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 316 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 308 of file mlErrorMacros.h.

◆ ML_TRY

#define ML_TRY   try

Definition at line 64 of file mlErrorMacros.h.