|
slot 0.0.1
A real time UI render framework
|
ResourceManager 内部使用的分类型所有权容器。 更多...
#include <ResourcePool.h>

Public 成员函数 | |
| ResourceRef< ResourceTy > | Add (std::string assetId, std::unique_ptr< ResourceTy > resource) |
| ResourceRef< ResourceTy > | Find (const std::string &assetId) const |
| size_t | Size () const |
| ResourceTy * | TryGet (ResourceRef< ResourceTy > reference) |
| const ResourceTy * | TryGet (ResourceRef< ResourceTy > reference) const |
| template<typename VisitorTy > | |
| void | Visit (VisitorTy &&visitor) const |
Private 属性 | |
| std::vector< std::unique_ptr< ResourceTy > > | Slots |
| std::unordered_map< std::string, ResourceRef< ResourceTy > > | AssetIndex |
ResourceManager 内部使用的分类型所有权容器。
每个槽位独占一个资源对象;外部只保存已解析的 ResourceRef。资源在应用退出前 常驻且槽位不复用,因此 Index 在 ResourceManager 生命周期内保持稳定。
|
inline |
接管资源所有权并返回已解析引用;空资源、空 ID 或重复 ID 返回空引用。
|
inline |
只解析已驻留资源,不触发加载;未知 ID 返回空引用。
|
inline |
|
inline |
校验已解析 Index 后返回观察指针,待解析或越界引用返回空。
|
inline |
const 查询与可写查询保持相同的索引有效性规则。

|
inline |
按稳定槽位顺序访问驻留资源,供 GPU 缓存确定性构建。
|
private |
|
private |