NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
载入中...
搜索中...
未找到
neforce::reflect::meta_enum类 参考

枚举反射元数据类 更多...

#include <enum.hpp>

Public 成员函数

 meta_enum (string_view name, type_id underlying_id)
 构造函数
void add_entry (string_view entry_name, const int64_t entry_value)
 添加枚举条目
string_view name () const noexcept
 获取枚举类型名称
type_id underlying_type_id () const noexcept
 获取底层类型 ID
const vector< enum_entry > & entries () const noexcept
 获取所有枚举条目
bool value_of (string_view entry_name, int64_t &out_value) const noexcept
 通过名称查找枚举值
string_view name_of (const int64_t entry_value) const noexcept
 通过数值查找枚举名称

详细描述

枚举反射元数据类

描述一个枚举类型的元信息,支持名称与值的双向查找。

在文件 enum.hpp38 行定义.

构造及析构函数说明

◆ meta_enum()

neforce::reflect::meta_enum::meta_enum ( string_view name,
type_id underlying_id )
inline

构造函数

参数
name枚举类型名称
underlying_id底层类型 ID

在文件 enum.hpp50 行定义.

引用了 name().

成员函数说明

◆ add_entry()

void neforce::reflect::meta_enum::add_entry ( string_view entry_name,
const int64_t entry_value )
inline

添加枚举条目

参数
entry_name条目名称
entry_value条目数值

在文件 enum.hpp59 行定义.

◆ name_of()

string_view neforce::reflect::meta_enum::name_of ( const int64_t entry_value) const
inlinenodiscardnoexcept

通过数值查找枚举名称

参数
entry_value条目数值
返回
找到返回名称视图,否则返回空视图

在文件 enum.hpp97 行定义.

◆ value_of()

bool neforce::reflect::meta_enum::value_of ( string_view entry_name,
int64_t & out_value ) const
inlinenodiscardnoexcept

通过名称查找枚举值

参数
entry_name条目名称
out_value输出参数,接收查找到的数值
返回
找到返回 true

在文件 enum.hpp82 行定义.


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