libxr 1.0
Want to be the best embedded framework
|
运行时错误检查的断言工具类。 Provides assertion mechanisms for runtime error checking. More...
#include <libxr_assert.hpp>
Static Public Member Functions | |
static void | RegisterFatalErrorCB (const LibXR::Callback< const char *, uint32_t > &cb) |
注册致命错误的回调函数。 Registers a fatal error callback. | |
static void | RegisterFatalErrorCB (LibXR::Callback< const char *, uint32_t > &&cb) |
通过移动语义注册致命错误的回调函数。 Registers a fatal error callback with move semantics. | |
template<SizeLimitMode mode> | |
static void | SizeLimitCheck (size_t limit, size_t size) |
在非调试模式下的占位大小检查函数(无实际作用)。 Dummy size limit check for non-debug builds. | |
Static Public Attributes | |
static std::optional< LibXR::Callback< const char *, uint32_t > > | libxr_fatal_error_callback_ |
存储已注册的致命错误回调函数。 Stores the 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.
|
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 51 of file libxr_assert.hpp.
|
inlinestatic |
通过移动语义注册致命错误的回调函数。 Registers a fatal error callback with move semantics.
该重载版本允许通过移动回调对象,提高回调函数注册的效率。 This overload allows for efficient callback assignment by moving 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 |
存储已注册的致命错误回调函数。 Stores the registered fatal error callback.
该可选回调函数用于处理致命错误,如果未注册,则为空。 This optional callback is used to handle fatal errors if registered.
Definition at line 134 of file libxr_assert.hpp.