补全边角
This commit is contained in:
@@ -95,6 +95,7 @@ Descriptor 暴露编译期结构事实:
|
||||
using Property = std::remove_cvref_t<decltype(schema.property<&Device::temperature>())>;
|
||||
static_assert(Property::readable);
|
||||
static_assert(Property::writable);
|
||||
static_assert(Property::runtime_copy_writable);
|
||||
using Value = Property::value_type;
|
||||
using Accessor = Property::accessor_type;
|
||||
```
|
||||
@@ -562,7 +563,7 @@ auto result = erased.runtime_read("temperature", context, callback);
|
||||
auto result = erased.runtime_write("temperature", typeid(double), &value);
|
||||
```
|
||||
|
||||
Runtime write 明确不做隐式转换。`typeid(double)` 必须与 Property 声明的 value type 完全一致,`value` 指针在调用期间必须指向这个精确类型的有效对象。成功写入复用 typed `write` 的同一 managed write 和 synchronization 语义。
|
||||
Runtime write 明确不做隐式转换。`typeid(double)` 必须与 Property 声明的 value type 完全一致,`value` 指针在调用期间必须指向这个精确类型的有效对象。这个边界从 `const` 输入复制;如果一个 intrinsically writable Accessor 无法接受 copy-input,它会暴露 `runtime_copy_writable == false`,runtime access 返回 `unsupported_runtime_write`,而 typed `write` 在 Accessor 支持时仍可正常接收 move-only 值。成功写入继续复用 typed `write` 的 managed synchronization 路径。
|
||||
|
||||
### 22.3 Result Contract
|
||||
|
||||
@@ -572,6 +573,7 @@ Runtime write 明确不做隐式转换。`typeid(double)` 必须与 Property 声
|
||||
| `unknown_property` | Schema 中不存在该 runtime key |
|
||||
| `not_readable` | Property 存在,但 intrinsic capability 不可读 |
|
||||
| `not_writable` | Property 存在,但 intrinsic capability 不可写 |
|
||||
| `unsupported_runtime_write` | Property intrinsically writable,但 Accessor 无法接收 runtime copy-input 边界 |
|
||||
| `type_mismatch` | runtime write 提供的类型和 Property value type 不一致 |
|
||||
|
||||
这里没有 external/persistence mode,也没有访问控制 policy。Adapter 自己决定是否对外暴露、是否调用 runtime read/write;Structive 只报告 Property 自身的 intrinsic capability。
|
||||
|
||||
Reference in New Issue
Block a user