计算属性自动检查

This commit is contained in:
2026-08-11 11:54:09 +08:00
parent 11407faf86
commit e91f134f16
14 changed files with 305 additions and 51 deletions
+3 -3
View File
@@ -180,14 +180,14 @@ This relies on the Structive managed contract. If another thread deliberately wr
A computed property is usually intrinsically read-only, but it may read writable dependencies.
```cpp
computed_property<Device, int>([](const auto& view) {
computed_property<Device, int>(depends_on<&Device::min_speed, &Device::max_speed>, [](const auto& view) {
return view.template get<&Device::max_speed>() - view.template get<&Device::min_speed>();
}, key<"speed_span">)
```
The computed value has no writable storage of its own. Its synchronized view protects the consistency domain of writable dependencies. Read-only stored dependencies can be read directly because they cannot change through the managed path.
The computed value has no writable storage of its own. Dependencies are explicit Schema facts, and the computed view can read only declared direct dependencies. Read-only stored dependencies can be read directly because they cannot change through the managed path.
Writable dependencies that must form one snapshot should be placed in the same synchronization group as the computed property.
Writable dependencies that must form one snapshot should be placed in the same synchronization group with each other. The computed property's read slot is derived from its dependency graph and must not be configured directly in synchronization rules.
## Managed access and raw access