Weak path→clip registry for animation hot reload. 更多...
#include <AnimClipRegistry.h>
类 | |
| struct | ReloadEvent |
| Owning event value emitted after an EVA path reload attempt. 更多... | |
Public 类型 | |
| using | ReloadCallback = std::function< void(const ReloadEvent &)> |
静态 Public 成员函数 | |
| static void | registerPath (const std::string &path, AnimClip *clip) |
| Track a clip under a source path (keys are normalized). | |
| static void | unregister (AnimClip *clip) |
| Forget a clip everywhere (called from ~AnimClip). | |
| static std::vector< AnimClip * > | findByPath (const std::string &path) |
| Clips registered under a path; may be empty. | |
| static bool | hasPath (const std::string &path) |
| Whether any clip is registered under this path. | |
| static eve::Result< int > | reloadPath (const std::string &path) |
| Reload a path and report a structured import failure. | |
| static eve::Subscription | subscribeReload (ReloadCallback callback) |
| Subscribe to reload attempts; token disposal is owner-thread-affine. | |
| static std::uint64_t | reloadCallbackFailureCount () |
| Number of reload listener exceptions contained so far. | |
| static int | count () |
| Total registered clips (tests). | |
| static void | clear () |
| Drop all entries (tests). | |
| static std::string | normalizePath (const std::string &path) |
| Normalize a path to the registry key form. | |
详细描述
Weak path→clip registry for animation hot reload.
Animation::newClipFromAnimationFixtureText registers every clip it creates under its source path. When that *.anim.txt fixture changes, the "animclip" IAssetReloader re-imports the source and adopts the fresh content into the registered instances (AnimClip::adopt), so existing holders — state machines, scripts — keep valid pointers and see updated content without re-binding.
Entries hold raw pointers and are removed automatically by ~AnimClip; registrations must not outlive the clip (the engine's script bindings keep clips alive for the process lifetime, and tests use owning pointers).
在文件 AnimClipRegistry.h 第 30 行定义.
成员类型定义说明
◆ ReloadCallback
| using eve::animation::AnimClipRegistry::ReloadCallback = std::function<void(const ReloadEvent&)> |
在文件 AnimClipRegistry.h 第 38 行定义.
成员函数说明
◆ clear()
|
static |
◆ count()
|
static |
◆ findByPath()
|
static |
Clips registered under a path; may be empty.
在文件 AnimClipRegistry.cpp 第 97 行定义.
引用了 entries, normalizePath() , 以及 path.
被这些函数引用 eve::editor::AnimationRootMotionPreviewSource::sampleRootMotion().
◆ hasPath()
|
static |
Whether any clip is registered under this path.
在文件 AnimClipRegistry.cpp 第 102 行定义.
引用了 entries, normalizePath() , 以及 path.
◆ normalizePath()
|
static |
Normalize a path to the registry key form.
在文件 AnimClipRegistry.cpp 第 72 行定义.
被这些函数引用 findByPath(), hasPath(), registerPath() , 以及 reloadPath().
◆ registerPath()
|
static |
Track a clip under a source path (keys are normalized).
在文件 AnimClipRegistry.cpp 第 79 行定义.
引用了 clip, entries, normalizePath() , 以及 path.
被这些函数引用 eve::animation::Animation::newClipFromAnimationFixtureText().
◆ reloadCallbackFailureCount()
|
static |
Number of reload listener exceptions contained so far.
在文件 AnimClipRegistry.cpp 第 141 行定义.
◆ reloadPath()
|
static |
Reload a path and report a structured import failure.
- 返回
- Refreshed clip count; an unknown path is a successful NoOp.
- 备注
- The reload mutation is completed before listeners run. Listener exceptions are contained and counted, never used to roll back adopted clips.
在文件 AnimClipRegistry.cpp 第 104 行定义.
引用了 eve::Applied, clip, end, entries, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::animation::AnimImporter::importAnimationFixtureTextFile(), eve::NoOp, normalizePath(), path, eve::Status::success() , 以及 eve::Result< T >::success().
◆ subscribeReload()
|
static |
Subscribe to reload attempts; token disposal is owner-thread-affine.
在文件 AnimClipRegistry.cpp 第 137 行定义.
引用了 callback.
◆ unregister()
|
static |
Forget a clip everywhere (called from ~AnimClip).
在文件 AnimClipRegistry.cpp 第 85 行定义.
该类的文档由以下文件生成:
- src/modules/animation/AnimClipRegistry.h
- src/modules/animation/AnimClipRegistry.cpp