libxr
1.0
Want to be the best embedded framework
|
运行时错误检查的断言工具类。 Provides assertion mechanisms for runtime error checking. More...
#include <libxr_assert.hpp>
Public Types | |
using | Callback = LibXR::Callback<const char *, uint32_t> |
Static Public Member Functions | |
static void | RegisterFatalErrorCB (const Callback &cb) |
注册致命错误的回调函数。 Registers a fatal error callback. | |
template<typename T > | |
static void | RegisterFatalErrorCB (T &&cb) |
注册致命错误的回调函数。 Registers a fatal error callback | |
template<SizeLimitMode mode> | |
static void | SizeLimitCheck (size_t limit, size_t size) |
在非调试模式下的占位大小检查函数(无实际作用)。 Dummy size limit check for non-debug builds. | |
Static Public Attributes | |
static Callback | libxr_fatal_error_callback_ |
已注册的致命错误回调函数。 Registered fatal error callback. | |
运行时错误检查的断言工具类。 Provides assertion mechanisms for runtime error checking.
Assert
类提供了注册和处理致命错误的机制,支持回调函数,并可执行 运行时的大小限制检查(仅在调试模式下启用)。 The Assert
class is designed to register and handle fatal errors through callback functions and provides size limit verification.
Definition at line 39 of file libxr_assert.hpp.
using LibXR::Assert::Callback = LibXR::Callback<const char *, uint32_t> |
Definition at line 42 of file libxr_assert.hpp.
|
inlinestatic |
注册致命错误的回调函数。 Registers a fatal error callback.
该回调函数会在发生致命错误时被触发,用于执行相应的错误处理逻辑。 This callback will be triggered when a fatal error occurs.
cb | 要注册的回调函数。 The callback function to be registered. |
Definition at line 52 of file libxr_assert.hpp.
|
inlinestatic |
注册致命错误的回调函数。 Registers a fatal error callback
T | 回调对象类型 The type of the callback object. |
cb | 要注册的回调函数。The callback function to be registered. |
Definition at line 66 of file libxr_assert.hpp.
|
inlinestatic |
在非调试模式下的占位大小检查函数(无实际作用)。 Dummy size limit check for non-debug builds.
在发布模式下,该函数不会执行任何操作,以避免不必要的开销。 In release mode, this function does nothing to avoid unnecessary checks.
mode | 大小检查模式(EQUAL , MORE , LESS )。 The size constraint mode. |
limit | 参考限制值。 The reference limit value. |
size | 要检查的实际大小。 The actual size to be checked. |
Definition at line 119 of file libxr_assert.hpp.
|
inlinestatic |
已注册的致命错误回调函数。 Registered fatal error callback.
Definition at line 131 of file libxr_assert.hpp.