|
NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
|
错误类别抽象基类 更多...
#include <error_category.hpp>
Public 成员函数 | |
| virtual const char * | name () const noexcept=0 |
| 获取错误类别名称 | |
| virtual string | message (int32_t ev) const =0 |
| 获取错误码对应的可读描述 | |
| virtual error_condition | default_error_condition (int32_t ev) const noexcept |
| 获取错误码对应的默认错误条件 | |
| virtual bool | equivalent (int code, const error_condition &condition) const noexcept |
| 检查错误码与错误条件是否等价 | |
| virtual bool | equivalent (const error_code &code, int condition) const noexcept |
| 检查错误码与错误条件是否等价 | |
| Public 成员函数 继承自 neforce::icomparable< error_category > | |
| constexpr bool | operator== (const error_category &rhs) const noexcept(noexcept(derived().equal_to(rhs))) |
| 相等比较运算符 | |
| constexpr bool | operator!= (const error_category &rhs) const noexcept(noexcept(!(derived().equal_to(rhs)))) |
| 不等比较运算符 | |
| constexpr bool | operator< (const error_category &rhs) const noexcept(noexcept(derived().less_than(rhs))) |
| 小于比较运算符 | |
| constexpr bool | operator> (const error_category &rhs) const noexcept(noexcept(rhs.less_than(derived()))) |
| 大于比较运算符 | |
| constexpr bool | operator<= (const error_category &rhs) const noexcept(noexcept(!(rhs.less_than(derived())))) |
| 小于等于比较运算符 | |
| constexpr bool | operator>= (const error_category &rhs) const noexcept(noexcept(!(derived().less_than(rhs)))) |
| 大于等于比较运算符 | |
静态 Public 成员函数 | |
| static const error_category & | generic () noexcept |
| 获取通用错误类别单例 | |
| static const error_category & | system () noexcept |
| 获取系统错误类别单例 | |
错误类别抽象基类
定义错误类别的核心接口。每个错误类别以单例形式存在, 通过地址比较区分,提供错误码到可读消息的映射能力。
内置两种标准类别:
在文件 error_category.hpp 第 37 行定义.
|
nodiscardvirtualnoexcept |
获取错误码对应的默认错误条件
| ev | 错误码值 |
将当前类别的错误码映射到跨类别的通用错误条件。
被 neforce::generic_error_category , 以及 neforce::system_error_category 重载.
引用了 default_error_condition().
被这些函数引用 default_error_condition().
|
nodiscardvirtualnoexcept |
|
nodiscardvirtualnoexcept |
检查错误码与错误条件是否等价
| code | 错误码值 |
| condition | 错误条件 |
引用了 equivalent().
被这些函数引用 equivalent() , 以及 equivalent().
获取错误码对应的可读描述
| ev | 错误码值 |
在 neforce::generic_error_category, neforce::ssl_error_category , 以及 neforce::system_error_category 内被实现.
引用了 message().
被这些函数引用 message().
|
nodiscardpure virtualnoexcept |
获取错误类别名称
在 neforce::generic_error_category, neforce::ssl_error_category , 以及 neforce::system_error_category 内被实现.