|
Common System 0.2.0
Common interfaces and patterns for system integration
|
Error category for common/shared error codes. More...
#include <error_category.h>


Public Types | |
| enum | codes : int { success = 0 , unknown_error = -1 , invalid_argument = -2 , not_found = -3 , permission_denied = -4 , timeout = -5 , cancelled = -6 , not_initialized = -7 , already_exists = -8 , out_of_memory = -9 , io_error = -10 , operation_not_supported = -11 , internal_error = -99 } |
| Common error codes. More... | |
Public Member Functions | |
| std::string_view | name () const noexcept override |
| Returns the category name. | |
| std::string | message (int code) const override |
| Returns a human-readable message for the error code. | |
Public Member Functions inherited from kcenon::common::error_category | |
| virtual | ~error_category ()=default |
| Virtual destructor for proper cleanup of derived classes. | |
| virtual bool | equivalent (int code, const error_category &other_category, int other_code) const noexcept |
| Checks if an error code in this category is equivalent to another. | |
| bool | operator== (const error_category &other) const noexcept |
| Equality comparison between categories. | |
| bool | operator!= (const error_category &other) const noexcept |
| Inequality comparison between categories. | |
| bool | operator< (const error_category &other) const noexcept |
| Less-than comparison for use in ordered containers. | |
Static Public Member Functions | |
| static const common_error_category & | instance () noexcept |
| Returns the singleton instance of common_error_category. | |
Private Member Functions | |
| common_error_category ()=default | |
Additional Inherited Members | |
Protected Member Functions inherited from kcenon::common::error_category | |
| error_category ()=default | |
| Protected default constructor. | |
| error_category (const error_category &)=delete | |
| error_category & | operator= (const error_category &)=delete |
| error_category (error_category &&)=delete | |
| error_category & | operator= (error_category &&)=delete |
Error category for common/shared error codes.
This category contains error codes that are truly common across all systems:
System-specific errors should NOT be added here. Instead, each system should define its own error category.
Definition at line 176 of file error_category.h.
| enum kcenon::common::common_error_category::codes : int |
Common error codes.
These are error codes that apply universally across all systems. System-specific error codes should be defined in their respective error categories.
| Enumerator | |
|---|---|
| success | |
| unknown_error | |
| invalid_argument | |
| not_found | |
| permission_denied | |
| timeout | |
| cancelled | |
| not_initialized | |
| already_exists | |
| out_of_memory | |
| io_error | |
| operation_not_supported | |
| internal_error | |
Definition at line 185 of file error_category.h.
|
privatedefault |
|
inlinestaticnoexcept |
Returns the singleton instance of common_error_category.
Thread-safe due to C++11 static local variable initialization.
Definition at line 208 of file error_category.h.
Referenced by kcenon::common::typed_error_code::clear(), and kcenon::common::make_typed_error_code().

|
inlineoverridevirtual |
Returns a human-readable message for the error code.
| code | Error code value |
Implements kcenon::common::error_category.
Definition at line 226 of file error_category.h.
References already_exists, cancelled, internal_error, invalid_argument, io_error, not_found, not_initialized, operation_not_supported, out_of_memory, permission_denied, success, timeout, and unknown_error.
|
inlineoverridevirtualnoexcept |
Returns the category name.
Implements kcenon::common::error_category.
Definition at line 217 of file error_category.h.