React-style UI component: implement build(); setState / markDirty schedules one update before UI rendering. Mounts onto a named UIHost via mountAs / attach. 更多...
#include <Component.h>
Public 成员函数 | |
| Component () | |
| Create an unmounted component; attaching schedules its first update. | |
| Component (const Component &)=delete | |
| Component & | operator= (const Component &)=delete |
| Component (Component &&)=delete | |
| Component & | operator= (Component &&)=delete |
| virtual | ~Component () |
| Component. | |
| virtual WidgetDesc | build ()=0 |
| Builds . | |
| void | attach (UIHostHandle host) |
| Attaches . | |
| void | mountAs (const std::string &hostName) |
| Mounts as. | |
| UIHostHandle | host () const noexcept |
| Returns the attached host handle, or an empty handle before attach. | |
| void | rebuild (bool forceFull=false) |
| Compatibility-only synchronous refresh; normal edits use markDirty / setState. @cost Builds the complete description tree and reconciles by key; call once per edit batch. @reentrancy May invoke build(); recursively rebuilding or destroying this component during build is invalid. | |
| void | markDirty () |
| Schedule one rebuild; repeated calls before the next preparation phase coalesce. @thread Owner thread; no callbacks. Edits during build schedule the following batch. @lifetime Destroying the component invalidates its weak scheduling registration. | |
| bool | isDirty () const |
| True when dirty. | |
| bool | updateIfDirty () |
| Compatibility-only synchronous update; normal edits are flushed automatically. | |
Protected 成员函数 | |
| void | setState () |
| Subclasses call after mutating local state that affects build(). | |
详细描述
React-style UI component: implement build(); setState / markDirty schedules one update before UI rendering. Mounts onto a named UIHost via mountAs / attach.
在文件 Component.h 第 25 行定义.
构造及析构函数说明
◆ Component() [1/3]
| eve::ui::Component::Component | ( | ) |
Create an unmounted component; attaching schedules its first update.
在文件 Component.cpp 第 43 行定义.
引用了 detail.
◆ Component() [2/3]
|
delete |
◆ Component() [3/3]
|
delete |
◆ ~Component()
|
virtual |
在文件 Component.cpp 第 44 行定义.
成员函数说明
◆ attach()
| void eve::ui::Component::attach | ( | UIHostHandle | host | ) |
◆ build()
|
pure virtual |
◆ host()
|
inlinenoexcept |
Returns the attached host handle, or an empty handle before attach.
在文件 Component.h 第 44 行定义.
◆ isDirty()
|
inline |
True when dirty.
在文件 Component.h 第 56 行定义.
◆ markDirty()
| void eve::ui::Component::markDirty | ( | ) |
Schedule one rebuild; repeated calls before the next preparation phase coalesce. @thread Owner thread; no callbacks. Edits during build schedule the following batch. @lifetime Destroying the component invalidates its weak scheduling registration.
在文件 Component.cpp 第 45 行定义.
被这些函数引用 attach(), eve::ui::PropertyComponent::bind(), rebuild() , 以及 eve::ui::PropertyComponent::setOptions().
◆ mountAs()
| void eve::ui::Component::mountAs | ( | const std::string & | hostName | ) |
Mounts as.
在文件 Component.cpp 第 58 行定义.
引用了 attach(), eve::ui::UIHost::createHost(), eve::ui::UISystem::findHost(), h, rebuild() , 以及 eve::ui::UIHost::resolve().
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ rebuild()
| void eve::ui::Component::rebuild | ( | bool | forceFull = false | ) |
Compatibility-only synchronous refresh; normal edits use markDirty / setState. @cost Builds the complete description tree and reconciles by key; call once per edit batch. @reentrancy May invoke build(); recursively rebuilding or destroying this component during build is invalid.
在文件 Component.cpp 第 65 行定义.
引用了 build(), host(), markDirty() , 以及 eve::ui::UIHost::resolve().
被这些函数引用 mountAs() , 以及 updateIfDirty().
◆ setState()
|
inlineprotected |
Subclasses call after mutating local state that affects build().
在文件 Component.h 第 65 行定义.
◆ updateIfDirty()
| bool eve::ui::Component::updateIfDirty | ( | ) |
Compatibility-only synchronous update; normal edits are flushed automatically.
- 返回
- True when a live dirty component was rebuilt. @cost Complete tree construction/reconciliation when dirty; amortize once per edit batch.
在文件 Component.cpp 第 87 行定义.
引用了 rebuild() , 以及 eve::ui::UIHost::resolve().
该类的文档由以下文件生成:
- src/modules/ui/Component.h
- src/modules/ui/Component.cpp