|
SimpleKernel 1.17.0
|
资源 ID More...
#include <resource_id.hpp>

Public Member Functions | |
| constexpr auto | GetType () const -> ResourceType |
| 获取资源类型 | |
| constexpr auto | GetData () const -> uint64_t |
| 获取资源数据 | |
| constexpr auto | GetTypeName () const -> const char * |
| 获取类型名称(用于调试) | |
| constexpr | operator bool () const |
| 检查是否为有效资源 | |
| constexpr | operator uint64_t () const |
| 隐式转换到 uint64_t(用于存储和比较) | |
| constexpr auto | operator== (const ResourceId &other) const -> bool |
| 相等比较操作符 | |
| constexpr auto | operator!= (const ResourceId &other) const -> bool |
| 不等比较操作符 | |
构造/析构函数 | |
| constexpr | ResourceId (ResourceType type, uint64_t data) |
| 构造资源 ID | |
| ResourceId ()=default | |
| ResourceId (const ResourceId &)=default | |
| ResourceId (ResourceId &&)=default | |
| auto | operator= (const ResourceId &) -> ResourceId &=default |
| auto | operator= (ResourceId &&) -> ResourceId &=default |
| ~ResourceId ()=default | |
Private Attributes | |
| uint64_t | value_ {0} |
| 内部存储的原始值 | |
Static Private Attributes | |
| static constexpr uint8_t | kTypeShift = 56 |
| static constexpr uint64_t | kTypeMask = 0xFF00000000000000ULL |
| static constexpr uint64_t | kDataMask = 0x00FFFFFFFFFFFFFFULL |
资源 ID
[63:56] - 资源类型 (8 bits) [55:0] - 资源数据 (56 bits)
Definition at line 77 of file resource_id.hpp.
|
inlineconstexpr |
构造资源 ID
| type | 资源类型 |
| data | 资源数据 (如地址、PID 等) |
Definition at line 143 of file resource_id.hpp.
|
default |
|
default |
|
default |
|
default |
|
inlineconstexpr |
|
inlineconstexpr |
获取资源类型
Definition at line 83 of file resource_id.hpp.

|
inlineconstexpr |
获取类型名称(用于调试)
Definition at line 99 of file resource_id.hpp.

|
inlineexplicitconstexpr |
检查是否为有效资源
Definition at line 107 of file resource_id.hpp.

|
inlineconstexpr |
|
inlineconstexpr |
不等比较操作符
| other | 另一个资源 ID |
Definition at line 131 of file resource_id.hpp.
|
default |
|
default |
|
inlineconstexpr |
相等比较操作符
| other | 另一个资源 ID |
Definition at line 122 of file resource_id.hpp.
|
staticconstexprprivate |
Definition at line 158 of file resource_id.hpp.
|
staticconstexprprivate |
Definition at line 157 of file resource_id.hpp.
|
staticconstexprprivate |
Definition at line 156 of file resource_id.hpp.
|
private |