FActorTemplateRegistry
- Module
- Game
- Header
#include "Game/FActorTemplateRegistry.h"- Namespace
Mowo
Constructors
| Signature | Name | Description |
|---|---|---|
FActorTemplateRegistry(const FActorTemplateRegistry&) = delete | FActorTemplateRegistry |
Public functions
| Returns | Name | Description |
|---|---|---|
FActorTemplateRegistry& | Get | |
FActorTemplateRegistry& | operator= | |
AActor* | CreateTemplate | Build (or replace) a template named name off baseClass. |
void | RegisterTemplate | Register an already-constructed actor as the template name (roots it). |
AActor* | Find | The archetype actor for name, or nullptr. |
bool | Has | |
bool | Remove | Drop name (unroots its archetype so a later GC reclaims it). |
void | Clear | Drop every template (unroots each archetype). |
size_t | Num | |
size_t | RemoveAllInModule | Drops every template whose archetype's code lives in the unloading module (its vtable is in that image): the purge marks such an actor pending-kill, and a template left pointing at it would hand the next spawn freed memory. |
Function details
FActorTemplateRegistry
FActorTemplateRegistry(const FActorTemplateRegistry&) = deleteGet
static FActorTemplateRegistry& Get()operator=
FActorTemplateRegistry& operator=(const FActorTemplateRegistry&) = deleteCreateTemplate
AActor* CreateTemplate(FName name, MClass* baseClass)Build (or replace) a template named name off baseClass. The archetype is constructed through the class factory, its defaults cloned from the CDO, then GC-rooted and published by name. The caller customises the returned actor's fields to author the template's defaults. Returns nullptr when the class has no constructible CDO.
RegisterTemplate
void RegisterTemplate(FName name, AActor* archetype)Register an already-constructed actor as the template name (roots it). Used when the archetype comes from elsewhere (an instantiated prefab).
Find
AActor* Find(FName name) constThe archetype actor for name, or nullptr.
Has
bool Has(FName name) constRemove
bool Remove(FName name)Drop name (unroots its archetype so a later GC reclaims it).
Clear
void Clear()Drop every template (unroots each archetype). Tests call this so their archetypes do not linger as roots across suites.
Num
size_t Num() constRemoveAllInModule
size_t RemoveAllInModule(void* moduleHandle)Drops every template whose archetype's code lives in the unloading module (its vtable is in that image): the purge marks such an actor pending-kill, and a template left pointing at it would hand the next spawn freed memory.