|
NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
|
属性反射元数据类 更多...
#include <property.hpp>
Public 类型 | |
| using | getter = function<meta_any(const void*)> |
| 属性读取器类型 | |
| using | setter = function<void(void*, const meta_any&)> |
| 属性写入器类型 | |
Public 成员函数 | |
| meta_property (string_view name, reflect::type_id type_id, getter getter, setter setter, const uint16_t attrs=PROP_NONE) | |
| 构造函数 | |
| string_view | name () const noexcept |
| 获取属性名称 | |
| reflect::type_id | type_id () const noexcept |
| 获取属性类型ID | |
| uint16_t | attributes () const noexcept |
| 获取属性注解 | |
| void | set_attributes (const uint16_t attrs) noexcept |
| 设置属性注解 | |
| bool | is_transient () const noexcept |
| 是否为暂态属性(不参与序列化) | |
| bool | is_required () const noexcept |
| 是否为必填属性(反序列化时必须存在) | |
| bool | is_readonly () const noexcept |
| 是否为只读属性 | |
| bool | is_optional () const noexcept |
| 是否为可选属性 | |
| bool | is_versioned () const noexcept |
| 是否启用版本追踪 | |
| bool | is_primary_key () const noexcept |
| 是否为主键列 | |
| bool | is_auto_increment () const noexcept |
| 是否为自增列 | |
| bool | is_unique () const noexcept |
| 是否有唯一约束 | |
| bool | is_index () const noexcept |
| 是否有索引 | |
| bool | is_foreign_key () const noexcept |
| 是否为外键列 | |
| void | set_notify_signal (string_view signal_name) |
| 设置变更通知信号名称 | |
| string_view | notify_signal () const noexcept |
| 获取变更通知信号名称 | |
| bool | has_notify_signal () const noexcept |
| 是否有变更通知信号 | |
| uint32_t | version () const noexcept |
| 获取版本号 | |
| void | set_version (const uint32_t ver) noexcept |
| 设置版本号 | |
| meta_any | get (const void *obj) const |
| 获取属性值 | |
| bool | set (void *obj, const meta_any &value) const |
| 设置属性值 | |
| template<typename T, enable_if_t<!is_same_v< meta_any, decay_t< T > >, int > = 0> | |
| bool | set (void *obj, T &&value) const |
| 设置属性值(直接值版本) | |
|
inline |
构造函数
| name | 属性名称 |
| type_id | 属性类型ID |
| getter | 读取器 |
| setter | 写入器 |
| attrs | 属性注解 |
在文件 property.hpp 第 85 行定义.
引用了 neforce::move(), name(), neforce::reflect::PROP_NONE , 以及 type_id().
|
inlinenodiscardnoexcept |
|
inlinenodiscard |
|
inlinenodiscardnoexcept |
获取属性名称
在文件 property.hpp 第 97 行定义.
被这些函数引用 neforce::repository< T, Connect >::find_by_id() , 以及 meta_property().
|
inline |
|
inline |
设置属性值(直接值版本)
| T | 值类型 |
| obj | 对象指针 |
| value | 要设置的值 |
在文件 property.hpp 第 232 行定义.
引用了 neforce::forward() , 以及 set().
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenodiscardnoexcept |