2026-03-26 16:45:24 +08:00
|
|
|
# ComponentFactoryRegistry::RegisterFactory
|
|
|
|
|
|
2026-04-08 16:07:03 +08:00
|
|
|
**命名空间**: `XCEngine::Components`
|
|
|
|
|
|
|
|
|
|
**类型**: `method`
|
|
|
|
|
|
|
|
|
|
**头文件**: `XCEngine/Components/ComponentFactoryRegistry.h`
|
|
|
|
|
|
|
|
|
|
## 签名
|
2026-03-26 16:45:24 +08:00
|
|
|
|
|
|
|
|
```cpp
|
|
|
|
|
void RegisterFactory(const std::string& typeName, CreateComponentFn createFn);
|
|
|
|
|
```
|
|
|
|
|
|
2026-04-08 16:07:03 +08:00
|
|
|
## 作用
|
2026-03-26 16:45:24 +08:00
|
|
|
|
2026-04-08 16:07:03 +08:00
|
|
|
执行 `empty`、`insert_or_assign`、`push_back` 协同流程。
|
2026-03-26 16:45:24 +08:00
|
|
|
|
2026-04-08 16:07:03 +08:00
|
|
|
## 当前实现
|
2026-03-26 16:45:24 +08:00
|
|
|
|
2026-04-08 16:07:03 +08:00
|
|
|
- 当前实现会调用 `empty`、`insert_or_assign`、`push_back`。
|
2026-03-26 16:45:24 +08:00
|
|
|
|
|
|
|
|
## 相关文档
|
|
|
|
|
|
2026-04-08 16:07:03 +08:00
|
|
|
- [ComponentFactoryRegistry](ComponentFactoryRegistry.md)
|