NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
type_builder< T > 模板类 参考

类型反射构建器 更多...

#include <reflect.hpp>

Public 成员函数

 type_builder (string_view name)
 构造函数
template<typename Base>
type_builderbase ()
 添加基类(已解析)
type_builderbase (string_view base_name)
 添加基类(延迟解析)
template<typename U>
type_builderproperty (string_view name, U T::*member)
 添加属性
template<typename Ret, typename... Args>
type_builderfunction (string_view name, Ret(T::*func)(Args...))
 添加成员函数
template<typename Ret, typename... Args>
type_builderfunction (string_view name, Ret(T::*func)(Args...) const)
 添加常量成员函数
template<typename Ret, typename... Args>
type_builderstatic_function (string_view name, Ret(*func)(Args...))
 添加静态函数
type_builderconstructor ()
 添加默认构造函数
template<typename... Args>
type_builderconstructor ()
 添加带参数构造函数
NEFORCE_NODISCARD meta_typemeta () noexcept
 获取元数据对象
NEFORCE_NODISCARD const meta_typemeta () const noexcept
 获取常量元数据对象

详细描述

template<typename T>
class type_builder< T >

类型反射构建器

模板参数
T要注册的类型

提供链式API用于构建类型的反射信息。 通过反射函数创建,用于注册基类、属性、函数和构造函数。

在文件 reflect.hpp31 行定义.

构造及析构函数说明

◆ type_builder()

template<typename T>
type_builder< T >::type_builder ( string_view name)
inlineexplicit

构造函数

参数
name类型名称

在文件 reflect.hpp45 行定义.

引用了 name().

被这些函数引用 base(), base(), constructor(), function(), function(), property() , 以及 static_function().

成员函数说明

◆ base() [1/2]

template<typename T>
template<typename Base>
type_builder & type_builder< T >::base ( )
inline

添加基类(已解析)

模板参数
Base基类类型
返回
自身引用

在文件 reflect.hpp54 行定义.

引用了 registry::instance() , 以及 type_builder().

◆ base() [2/2]

template<typename T>
type_builder & type_builder< T >::base ( string_view base_name)
inline

添加基类(延迟解析)

参数
base_name基类名称
返回
自身引用

在文件 reflect.hpp64 行定义.

引用了 type_builder().

◆ constructor() [1/2]

template<typename T>
template<typename... Args>
type_builder & type_builder< T >::constructor ( )
inline

添加带参数构造函数

模板参数
Args参数类型列表
返回
自身引用

要求类型可从Args类型列表构造。

在文件 reflect.hpp167 行定义.

引用了 constructor(), is_constructible_v, vector< T, Alloc >::size() , 以及 type_builder().

◆ constructor() [2/2]

template<typename T>
type_builder & type_builder< T >::constructor ( )
inline

添加默认构造函数

返回
自身引用

要求类型是默认可构造的。

在文件 reflect.hpp153 行定义.

引用了 constructor(), is_default_constructible_v , 以及 type_builder().

被这些函数引用 constructor().

◆ function() [1/2]

template<typename T>
template<typename Ret, typename... Args>
type_builder & type_builder< T >::function ( string_view name,
Ret(T::* func )(Args...) const )
inline

添加常量成员函数

模板参数
Ret返回值类型
Args参数类型列表
参数
name函数名称
func常量成员函数指针
返回
自身引用

在文件 reflect.hpp122 行定义.

引用了 move(), name() , 以及 type_builder().

◆ function() [2/2]

template<typename T>
template<typename Ret, typename... Args>
type_builder & type_builder< T >::function ( string_view name,
Ret(T::* func )(Args...) )
inline

添加成员函数

模板参数
Ret返回值类型
Args参数类型列表
参数
name函数名称
func成员函数指针
返回
自身引用

在文件 reflect.hpp104 行定义.

引用了 move(), name() , 以及 type_builder().

◆ meta() [1/2]

template<typename T>
NEFORCE_NODISCARD const meta_type & type_builder< T >::meta ( ) const
inlinenoexcept

获取常量元数据对象

返回
元数据常量引用

在文件 reflect.hpp188 行定义.

◆ meta() [2/2]

template<typename T>
NEFORCE_NODISCARD meta_type & type_builder< T >::meta ( )
inlinenoexcept

获取元数据对象

返回
元数据引用

在文件 reflect.hpp182 行定义.

◆ property()

template<typename T>
template<typename U>
type_builder & type_builder< T >::property ( string_view name,
U T::* member )
inline

添加属性

模板参数
U属性类型
参数
name属性名称
member成员指针
返回
自身引用

在文件 reflect.hpp77 行定义.

引用了 move(), name(), type_builder() , 以及 type_name_v.

◆ static_function()

template<typename T>
template<typename Ret, typename... Args>
type_builder & type_builder< T >::static_function ( string_view name,
Ret(* func )(Args...) )
inline

添加静态函数

模板参数
Ret返回值类型
Args参数类型列表
参数
name函数名称
func函数指针
返回
自身引用

在文件 reflect.hpp140 行定义.

引用了 move(), name() , 以及 type_builder().


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