Creates components by type id and tells which class an id belongs to.
More...
#include <deki/reflection/ComponentFactory.h>
Creates components by type id and tells which class an id belongs to.
Lookups are O(1).
◆ Instance()
| ComponentFactory & Deki::ComponentFactory::Instance |
( |
| ) |
|
|
static |
◆ Register()
Registers a component class.
Registering the same id again replaces the entry, which a hot-reloaded package needs.
◆ Unregister()
| void Deki::ComponentFactory::Unregister |
( |
uint32_t | typeId | ) |
|
|
inline |
Removes a component class, when its package unloads.
◆ Find()
The class entry for a type id, or nullptr when unknown.
◆ Create()
| Component * Deki::ComponentFactory::Create |
( |
uint32_t | typeId | ) |
const |
|
inline |
Creates a component by type id, with its type info attached.
Returns nullptr when the id is unknown or the class is abstract.
◆ IsRegistered()
| bool Deki::ComponentFactory::IsRegistered |
( |
uint32_t | typeId | ) |
const |
|
inline |
◆ GetRegisteredCount()
| size_t Deki::ComponentFactory::GetRegisteredCount |
( |
| ) |
const |
|
inline |
◆ Clear()
| void Deki::ComponentFactory::Clear |
( |
| ) |
|
|
inline |
Removes every registered class, for plugin hot-reload.
The documentation for this class was generated from the following file: