![]() |
Ark Server API (ASA) - Wiki
|
#include "CoreTypes.h"#include "HAL/Platform.h"#include "HAL/PlatformMisc.h"#include "HAL/PreprocessorHelpers.h"#include "Templates/AndOrNot.h"#include "Templates/EnableIf.h"#include "Templates/IsArrayOrRefOfTypeByPredicate.h"#include "Templates/IsValidVariadicFunctionArg.h"#include "Traits/IsCharEncodingCompatibleWith.h"#include "Misc/VarArgs.h"
Include dependency graph for AssertionMacros.h:Go to the source code of this file.
Classes | |
| struct | FEnsureHandlerArgs |
| struct | FDebug |
Namespaces | |
| namespace | ELogVerbosity |
| namespace | UEAsserts_Private |
Functions | |
| void | PrintScriptCallstack () |
| template<typename RetType = void, class InnerType , typename... ArgTypes> | |
| RetType FORCENOINLINE UE_DEBUG_SECTION | DispatchCheckVerify (InnerType &&Inner, ArgTypes const &... Args) |
| template<typename T > | |
| bool | UEAsserts_Private::GetMemberNameCheckedJunk (const T &) |
| template<typename T > | |
| bool | UEAsserts_Private::GetMemberNameCheckedJunk (const volatile T &) |
| template<typename R , typename ... Args> | |
| bool | UEAsserts_Private::GetMemberNameCheckedJunk (R(*)(Args...)) |
| void VARARGS | LowLevelFatalErrorHandler (const ANSICHAR *File, int32 Line, void *ProgramCounter, const TCHAR *Format=TEXT(""),...) |
Variables | |
| TFunction< bool(const FEnsureHandlerArgs &Args) | SetEnsureHandler )(TFunction< bool(const FEnsureHandlerArgs &Args)> EnsureHandler) |
| TFunction< bool(const FEnsureHandlerArgs &Args) | GetEnsureHandler )() |
| bool | GIgnoreDebugger |
| #define _DebugBreakAndPromptForRemote | ( | ) | UE_DEPRECATED_MACRO(5.1, "Use UE_DEBUG_BREAK_AND_PROMPT_FOR_REMOTE.") |
Definition at line 198 of file AssertionMacros.h.
| #define checkCode | ( | ... | ) |
Definition at line 304 of file AssertionMacros.h.
Definition at line 306 of file AssertionMacros.h.
Definition at line 324 of file AssertionMacros.h.
| #define checkNoEntry | ( | ) |
Definition at line 307 of file AssertionMacros.h.
| #define checkNoRecursion | ( | ) |
Definition at line 309 of file AssertionMacros.h.
| #define checkNoReentry | ( | ) |
Definition at line 308 of file AssertionMacros.h.
| #define ensure | ( | InExpression | ) | (!!(InExpression)) |
ensure() can be used to test for non-fatal errors at runtime
Rather than crashing, an error report (with a full call stack) will be logged and submitted to the crash server. This is useful when you want runtime code verification but you're handling the error case anyway.
Note: ensure() can be nested within conditionals!
Example:
if (ensure(InObject != nullptr))
{
InObject->Modify();
}
This code is safe to execute as the pointer dereference is wrapped in a non-nullptr conditional block, but you still want to find out if this ever happens so you can avoid side effects. Using ensure() here will force a crash report to be generated without crashing the application (and potentially causing editor users to lose unsaved work.)
ensure() resolves to just evaluate the expression when DO_CHECK is 0 (typically shipping or test builds).
By default a given call site will only print the callstack and submit the 'crash report' the first time an ensure is hit in a session; ensureAlways can be used instead if you want to handle every failure
Definition at line 381 of file AssertionMacros.h.
| #define ensureAlways | ( | InExpression | ) | (!!(InExpression)) |
Definition at line 383 of file AssertionMacros.h.
| #define ensureAlwaysMsgf | ( | InExpression, | |
| InFormat, | |||
| ... ) (!!(InExpression)) |
Definition at line 384 of file AssertionMacros.h.
| #define ensureMsgf | ( | InExpression, | |
| InFormat, | |||
| ... ) (!!(InExpression)) |
Definition at line 382 of file AssertionMacros.h.
| #define GET_ENUMERATOR_NAME_CHECKED | ( | EnumName, | |
| EnumeratorName ) ((void)sizeof(UEAsserts_Private::GetMemberNameCheckedJunk(EnumName::EnumeratorName)), FName(TEXT(#EnumeratorName))) |
Definition at line 400 of file AssertionMacros.h.
| #define GET_FUNCTION_NAME_CHECKED | ( | ClassName, | |
| FunctionName ) ((void)sizeof(&ClassName::FunctionName), FName(TEXT(#FunctionName))) |
Definition at line 411 of file AssertionMacros.h.
| #define GET_FUNCTION_NAME_CHECKED_FourParams | ( | ClassName, | |
| FunctionName, | |||
| ArgType1, | |||
| ArgType2, | |||
| ArgType3, | |||
| ArgType4 ) ((void)sizeof((std::declval<ClassName&>().FunctionName(std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType1)>(), std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType2)>(), std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType3)>(), std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType4)>()), (int)0)), FName(TEXT(#FunctionName))) |
Definition at line 428 of file AssertionMacros.h.
| #define GET_FUNCTION_NAME_CHECKED_OneParam | ( | ClassName, | |
| FunctionName, | |||
| ArgType ) ((void)sizeof((std::declval<ClassName&>().FunctionName(std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType)>()), (int)0)), FName(TEXT(#FunctionName))) |
Definition at line 419 of file AssertionMacros.h.
| #define GET_FUNCTION_NAME_CHECKED_ThreeParams | ( | ClassName, | |
| FunctionName, | |||
| ArgType1, | |||
| ArgType2, | |||
| ArgType3 ) ((void)sizeof((std::declval<ClassName&>().FunctionName(std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType1)>(), std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType2)>(), std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType3)>()), (int)0)), FName(TEXT(#FunctionName))) |
Definition at line 425 of file AssertionMacros.h.
| #define GET_FUNCTION_NAME_CHECKED_TwoParams | ( | ClassName, | |
| FunctionName, | |||
| ArgType1, | |||
| ArgType2 ) ((void)sizeof((std::declval<ClassName&>().FunctionName(std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType1)>(), std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType2)>()), (int)0)), FName(TEXT(#FunctionName))) |
Definition at line 422 of file AssertionMacros.h.
| #define GET_FUNCTION_NAME_STRING_CHECKED | ( | ClassName, | |
| FunctionName ) ((void)sizeof(&ClassName::FunctionName), TEXT(#FunctionName)) |
Definition at line 414 of file AssertionMacros.h.
| #define GET_FUNCTION_NAME_STRING_CHECKED_FourParams | ( | ClassName, | |
| FunctionName, | |||
| ArgType1, | |||
| ArgType2, | |||
| ArgType3, | |||
| ArgType4 ) ((void)sizeof((std::declval<ClassName&>().FunctionName(std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType1)>(), std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType2)>(), std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType3)>(), std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType4)>()), (int)0)), TEXT(#FunctionName)) |
Definition at line 440 of file AssertionMacros.h.
| #define GET_FUNCTION_NAME_STRING_CHECKED_OneParam | ( | ClassName, | |
| FunctionName, | |||
| ArgType ) ((void)sizeof((std::declval<ClassName&>().FunctionName(std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType)>()), (int)0)), TEXT(#FunctionName)) |
Definition at line 431 of file AssertionMacros.h.
| #define GET_FUNCTION_NAME_STRING_CHECKED_ThreeParams | ( | ClassName, | |
| FunctionName, | |||
| ArgType1, | |||
| ArgType2, | |||
| ArgType3 ) ((void)sizeof((std::declval<ClassName&>().FunctionName(std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType1)>(), std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType2)>(), std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType3)>()), (int)0)), TEXT(#FunctionName)) |
Definition at line 437 of file AssertionMacros.h.
| #define GET_FUNCTION_NAME_STRING_CHECKED_TwoParams | ( | ClassName, | |
| FunctionName, | |||
| ArgType1, | |||
| ArgType2 ) ((void)sizeof((std::declval<ClassName&>().FunctionName(std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType1)>(), std::declval<PREPROCESSOR_REMOVE_OPTIONAL_PARENS(ArgType2)>()), (int)0)), TEXT(#FunctionName)) |
Definition at line 434 of file AssertionMacros.h.
| #define GET_MEMBER_NAME_CHECKED | ( | ClassName, | |
| MemberName ) ((void)sizeof(UEAsserts_Private::GetMemberNameCheckedJunk(((ClassName*)0)->MemberName)), FName(TEXT(#MemberName))) |
Definition at line 404 of file AssertionMacros.h.
| #define GET_MEMBER_NAME_STRING_CHECKED | ( | ClassName, | |
| MemberName ) ((void)sizeof(UEAsserts_Private::GetMemberNameCheckedJunk(((ClassName*)0)->MemberName)), TEXT(#MemberName)) |
Definition at line 407 of file AssertionMacros.h.
Definition at line 450 of file AssertionMacros.h.
| #define PLATFORM_BREAK_IF_DESIRED | ( | ) | if (LIKELY(!GIgnoreDebugger)) { PLATFORM_BREAK(); } |
Definition at line 204 of file AssertionMacros.h.
| #define UE_DEBUG_BREAK_AND_PROMPT_FOR_REMOTE | ( | ) | if (!FPlatformMisc::IsDebuggerPresent()) { FPlatformMisc::PromptForRemoteDebugging(false); } UE_DEBUG_BREAK(); |
Definition at line 192 of file AssertionMacros.h.
| #define UE_DEBUG_SECTION |
Definition at line 27 of file AssertionMacros.h.
Definition at line 312 of file AssertionMacros.h.
Definition at line 311 of file AssertionMacros.h.
Definition at line 325 of file AssertionMacros.h.
| RetType FORCENOINLINE UE_DEBUG_SECTION DispatchCheckVerify | ( | InnerType && | Inner, |
| ArgTypes const &... | Args ) |
Definition at line 186 of file AssertionMacros.h.
| void VARARGS LowLevelFatalErrorHandler | ( | const ANSICHAR * | File, |
| int32 | Line, | ||
| void * | ProgramCounter, | ||
| const TCHAR * | Format = TEXT(""), | ||
| ... ) |
low level fatal error handler.
| void PrintScriptCallstack | ( | ) |
C Exposed function to print the callstack to ease debugging needs. In an editor build you can call this in the Immediate Window by doing, {,,UnrealEditor-Core}PrintScriptCallstack()
| TFunction< bool(const FEnsureHandlerArgs &Args) GetEnsureHandler) () | ( | ) |
|
extern |
| TFunction< bool(const FEnsureHandlerArgs &Args) SetEnsureHandler) (TFunction< bool(const FEnsureHandlerArgs &Args)> EnsureHandler) | ( | TFunction< bool(const FEnsureHandlerArgs &Args)> | EnsureHandler | ) |
Sets the thead_local ensure handler callback returning true skips the regular ensure handling logic returns the previous handler which maybe nullptr