|
slot 0.0.1
A real time UI render framework
|
资源的强类型引用,同时覆盖持久化 ID 与运行时索引两种边界。 更多...
#include <ResourceRef.h>

Public 成员函数 | |
| ResourceRef ()=default | |
| ResourceRef (uint32_t index) | |
| ResourceRef (std::string_view id) | |
| const std::string & | GetId () const |
| bool | IsResolved () const |
| bool | IsValid () const |
| bool | operator== (const ResourceRef &other) const |
| bool | operator!= (const ResourceRef &other) const |
Public 属性 | |
| uint32_t | Index = Invalid |
Private 属性 | |
| std::string | Id |
静态 Private 属性 | |
| static constexpr uint32_t | Invalid = std::numeric_limits<uint32_t>::max() |
资源的强类型引用,同时覆盖持久化 ID 与运行时索引两种边界。
场景和材质使用 Asset ID 构造待解析引用;ResourceManager::Resolve 将其转换为 只携带稳定池索引的已解析引用,供渲染热路径和 GPU 缓存使用。资源池当前只追加且 不复用槽位,因此索引在 Manager 生命周期内稳定,不需要额外的版本字段。
|
default |
构造既没有 Asset ID 也没有池索引的空引用。

|
inlineexplicit |
构造供资源访问和缓存使用的已解析引用。
|
inlineexplicit |
构造供场景、材质和序列化边界保存的待解析引用。
|
inline |
返回待解析 Asset ID;已解析引用不继续携带字符串。

|
inline |
只有获得池索引后,引用才可用于资源访问和后端缓存。

|
inline |
Asset ID 或池索引任一存在时,引用都具有可继续处理的有效状态。


|
inline |
提供与相等运算一致的否定比较。

|
inline |
同时比较引用状态与载荷,避免不同待解析 ID 被视为同一引用。
|
private |
| uint32_t z8::ResourceRef< ResourceTy >::Index = Invalid |
|
staticconstexprprivate |