补全边角

This commit is contained in:
2026-08-08 21:21:23 +08:00
parent a6d6f8c6d3
commit c51c9d2937
24 changed files with 359 additions and 56 deletions
+3 -1
View File
@@ -306,7 +306,7 @@ runtime_read(key, context, callback)
runtime_write(key, type_info, value)
```
返回 `ok``unknown_property``not_readable``not_writable``type_mismatch`。Runtime write 要求类型完全一致,不做隐式转换。Read callback 收到的是借用指针,只在 callback 期间有效;对于需要同步的 writable statecallback 执行期间 managed read lock 仍然持有。Stored read-only Property 继续走和 typed read 一样的 zero-lock fast path。
返回 `ok``unknown_property``not_readable``not_writable``unsupported_runtime_write``type_mismatch`。Runtime write 是精确类型的 copy-input 边界,不做隐式转换。如果 Accessor 只能接收 move-only 输入,Property 仍然可以保持 intrinsic `writable`,但会暴露 `runtime_copy_writable == false`typed `write` 仍然支持这种 Property。Read callback 收到的是借用指针,只在 callback 期间有效;对于需要同步的 writable statecallback 执行期间 managed read lock 仍然持有。Stored read-only Property 继续走和 typed read 一样的 zero-lock fast path。
Core 不在这个边界强制引入 `variant``any`、转换注册表或 serialization 所有权策略,上层 Adapter 可以按领域需要封装。这里没有 runtime access mode,也没有访问控制;外部系统自行决定暴露策略,Structive 只报告 Property intrinsic capability。详细契约见 [Core Guide: Runtime Access](docs/CORE_GUIDE.zh-CN.md#22-runtime-type-erased-access),测试见 `core/tests/runtime_api_test.cpp`
@@ -360,6 +360,8 @@ cmake --build build
ctest --test-dir build --output-on-failure
```
独立构建提供 `STRUCTIVE_BUILD_EXAMPLES``STRUCTIVE_BUILD_TESTS``STRUCTIVE_INSTALL`。Example 只在 Structive 作为顶层工程时默认开启;测试跟随 `BUILD_TESTING`;独立安装默认开启。安装后可通过 `find_package(Structive CONFIG)` 使用 `structive::property_core``structive::property_extensions`,并且 standalone CTest 会真实验证外部 install consumer。
## 详细文档
- [设计理念与原则](docs/DESIGN.zh-CN.md)