EVENGINE_API_FOUNDATION public API. 更多...
#include <AssetReloader.h>
Public 类型 | |
| enum | Priority { kCache = 0 , kTexture = 10 , kConsumer = 20 } |
| Priority public API. 更多... | |
Public 成员函数 | |
| virtual | ~IAssetReloader ()=default |
| virtual const char * | reloadKind () const =0 |
| Stable name for this reloader ("texture" / "particle" / "tilemap"). A path bound to this kind is offered here regardless of its extension. | |
| virtual bool | handlesPath (const std::string &normPath) const =0 |
| virtual Resource * | load (const std::string &key) |
Create the CPU-side resource identified by key (a normalized VFS path, optionally followed by ?param=value entries that change the decoded asset, e.g. "fonts/a.ttf?size=16"). | |
| virtual eve::Result< bool > | reload (const std::string &normPath)=0 |
Reload everything referencing normPath. | |
静态 Public 属性 | |
| static constexpr const char * | capabilityName = "IAssetReloader" |
详细描述
EVENGINE_API_FOUNDATION public API.
在文件 AssetReloader.h 第 32 行定义.
成员枚举类型说明
◆ Priority
Priority public API.
Suggested priorities; lower runs first.
| 枚举值 | |
|---|---|
| kCache | |
| kTexture | |
| kConsumer | |
在文件 AssetReloader.h 第 36 行定义.
构造及析构函数说明
◆ ~IAssetReloader()
|
virtualdefault |
成员函数说明
◆ handlesPath()
|
pure virtual |
Whether this reloader claims normPath during automatic dispatch. For providers of cached CPU resources the key may carry parameters ("fonts/a.ttf?size=16"); use ResourceManager::pathOfKey() to strip them.
在 eve::ResourceManager 内被实现.
◆ load()
|
inlinevirtual |
Create the CPU-side resource identified by key (a normalized VFS path, optionally followed by ?param=value entries that change the decoded asset, e.g. "fonts/a.ttf?size=16").
- 返回
- Borrowed raw pointer to a newly loaded resource, or nullptr when this provider does not claim the key. The caller (ResourceManager) caches the result and keeps it alive; later reloads drain the freshly loaded instance into the cached one via Resource::adopt, so the cached identity stays stable. @ownership Owned by the ResourceManager cache after return; the caller must not delete the pointer or transfer it elsewhere. @nullable Yes; nullptr means that this provider does not claim
key. @lifetime The pointer remains valid while the cache entry/provider-owned resource remains alive; it must not cross unload or module removal. @thread Provider-specific; reload dispatch itself is main-thread affine. @reentrancy The provider must not call back into the reloader registry while loading; callbacks occur after registry/cache locks are released.
被 eve::ResourceManager 重载.
在文件 AssetReloader.h 第 83 行定义.
◆ reload()
|
pure virtual |
Reload everything referencing normPath.
- 返回
- A checked result whose value is true when at least one object changed.
- 备注
- Failure is reported through the structured status; a successful false value means the provider handled the path but nothing changed.
在 eve::ResourceManager 内被实现.
◆ reloadKind()
|
pure virtual |
Stable name for this reloader ("texture" / "particle" / "tilemap"). A path bound to this kind is offered here regardless of its extension.
- 返回
- Borrowed, non-null, null-terminated text owned by the provider. @ownership Borrowed; the caller must not free or retain a mutable pointer. @lifetime Valid for the provider lifetime; implementations normally return a static string. It must not be retained past provider removal. @thread May be queried from the dispatch thread after registration settles. @reentrancy The call must not mutate the capability registry or invoke callbacks.
在 eve::ResourceManager 内被实现.
类成员变量说明
◆ capabilityName
|
staticconstexpr |
在文件 AssetReloader.h 第 42 行定义.
该类的文档由以下文件生成:
- src/engine/common/AssetReloader.h