Creates components by type id (see the file comment above).
More...
#include <ComponentFactory.h>
|
| static ComponentFactory & | Instance () |
| | Get singleton instance.
|
Creates components by type id (see the file comment above).
O(1) lookup for all components regardless of count. ~48 bytes memory per registered component.
◆ Instance()
| ComponentFactory & SceneFormat::ComponentFactory::Instance |
( |
| ) |
|
|
static |
◆ Register()
| void SceneFormat::ComponentFactory::Register |
( |
uint32_t | typeId, |
|
|
ComponentCreator | creator ) |
|
inline |
Register a component type for creation.
- Parameters
-
| typeId | Hash of component class name (use ClassName::StaticType) |
| creator | Function that creates a new instance |
◆ Unregister()
| void SceneFormat::ComponentFactory::Unregister |
( |
uint32_t | typeId | ) |
|
|
inline |
Unregister a component type.
- Parameters
-
| typeId | Hash of component class name |
◆ Create()
| DekiComponent * SceneFormat::ComponentFactory::Create |
( |
uint32_t | typeId | ) |
|
|
inline |
Create a component by type ID.
- Parameters
-
| typeId | Hash of component class name |
- Returns
- New component instance, or nullptr if type not found
◆ IsRegistered()
| bool SceneFormat::ComponentFactory::IsRegistered |
( |
uint32_t | typeId | ) |
const |
|
inline |
Check if a component type is registered.
- Parameters
-
| typeId | Hash of component class name |
- Returns
- true if type can be created
◆ GetRegisteredCount()
| size_t SceneFormat::ComponentFactory::GetRegisteredCount |
( |
| ) |
const |
|
inline |
Get number of registered components.
◆ Clear()
| void SceneFormat::ComponentFactory::Clear |
( |
| ) |
|
|
inline |
Clear all registered components.
Useful for plugin hot-reload scenarios.
The documentation for this class was generated from the following file: