ShitEngine
基于 C++20 与 SDL3 的轻量级 2D 游戏引擎
载入中...
搜索中...
未找到
TypeRegistry类 参考

#include <TypeRegistry.h>

Public 成员函数

void registerType (TypeInfo info)
void initBuiltinTypes ()
void resolveBases ()
 解析所有未解析的基类引用(消除 SIOF)
bool unregisterType (std::string_view name)
 按名称卸载类型
void setRegistrationSource (std::string_view source)
 设置后续注册类型的来源标记(空 = 引擎内置,插件注册前设为插件名)
size_t unregisterTypesBySource (std::string_view source)
 卸载指定来源注册的全部类型(插件卸载前调用,防止 factory 悬垂)
const TypeInfogetType (std::string_view name) const
const TypeInfogetType (std::type_index ti) const
 按 type_index 查询(Prefab 动态克隆等场景用)
template<typename T>
const TypeInfogetType () const
void forEach (std::function< void(const TypeInfo &)> callback) const
size_t count () const
 TypeRegistry (const TypeRegistry &)=delete
TypeRegistryoperator= (const TypeRegistry &)=delete
 TypeRegistry (TypeRegistry &&)=delete
TypeRegistryoperator= (TypeRegistry &&)=delete

静态 Public 成员函数

static TypeRegistryGetInstance ()
static void Register (TypeInfo info)
static void InitBuiltinTypes ()
static void ResolveBases ()
static bool UnregisterType (std::string_view name)
static void SetRegistrationSource (std::string_view source)
static size_t UnregisterTypesBySource (std::string_view source)
static const TypeInfoGet (std::string_view name)
static const TypeInfoGet (std::type_index ti)
template<typename T>
static const TypeInfoGet ()
static void ForEach (std::function< void(const TypeInfo &)> callback)
static size_t Count ()

友元

class EngineContext
class TypeInfoBuilder

构造及析构函数说明

◆ TypeRegistry() [1/2]

TypeRegistry ( const TypeRegistry & )
delete

◆ TypeRegistry() [2/2]

TypeRegistry ( TypeRegistry && )
delete

成员函数说明

◆ Count()

size_t Count ( )
inlinestatic

◆ count()

size_t count ( ) const
inlinenodiscard

◆ ForEach()

void ForEach ( std::function< void(const TypeInfo &)> callback)
inlinestatic

◆ forEach()

void forEach ( std::function< void(const TypeInfo &)> callback) const

◆ Get() [1/3]

template<typename T>
const TypeInfo * Get ( )
inlinestatic

◆ Get() [2/3]

const TypeInfo * Get ( std::string_view name)
inlinestatic

◆ Get() [3/3]

const TypeInfo * Get ( std::type_index ti)
inlinestatic

◆ GetInstance()

TypeRegistry & GetInstance ( )
static

◆ getType() [1/3]

template<typename T>
const TypeInfo * getType ( ) const
inlinenodiscard

◆ getType() [2/3]

const TypeInfo * getType ( std::string_view name) const
nodiscard

◆ getType() [3/3]

const TypeInfo * getType ( std::type_index ti) const
nodiscard

按 type_index 查询(Prefab 动态克隆等场景用)

◆ InitBuiltinTypes()

void InitBuiltinTypes ( )
inlinestatic

◆ initBuiltinTypes()

void initBuiltinTypes ( )

◆ operator=() [1/2]

TypeRegistry & operator= ( const TypeRegistry & )
delete

◆ operator=() [2/2]

TypeRegistry & operator= ( TypeRegistry && )
delete

◆ Register()

void Register ( TypeInfo info)
inlinestatic

◆ registerType()

void registerType ( TypeInfo info)

◆ ResolveBases()

void ResolveBases ( )
inlinestatic

◆ resolveBases()

void resolveBases ( )

解析所有未解析的基类引用(消除 SIOF)

◆ SetRegistrationSource()

void SetRegistrationSource ( std::string_view source)
inlinestatic

◆ setRegistrationSource()

void setRegistrationSource ( std::string_view source)

设置后续注册类型的来源标记(空 = 引擎内置,插件注册前设为插件名)

◆ UnregisterType()

bool UnregisterType ( std::string_view name)
inlinestatic

◆ unregisterType()

bool unregisterType ( std::string_view name)

按名称卸载类型

◆ UnregisterTypesBySource()

size_t UnregisterTypesBySource ( std::string_view source)
inlinestatic

◆ unregisterTypesBySource()

size_t unregisterTypesBySource ( std::string_view source)

卸载指定来源注册的全部类型(插件卸载前调用,防止 factory 悬垂)

◆ EngineContext

friend class EngineContext
friend

◆ TypeInfoBuilder

friend class TypeInfoBuilder
friend

该类的文档由以下文件生成: