Adapts command-backed editor properties to the shared MVVM contract. 更多...
#include <EditorPropertyModel.h>
类 | |
| struct | ObserverState |
Public 类型 | |
| using | EditSink = std::function< Result< void >(const PropertyEditIntent &)> |
Public 类型 继承自 eve::property_access::IPropertyAccess | |
| using | ChangeCallback = std::function< void(const PropertyChange &)> |
Public 成员函数 | |
| EditorPropertyModel (PropertySchema schema, SelectionSnapshot selection, const IPropertyProvider *provider, PropertyModelSurface surface=PropertyModelSurface::Developer, HostProfile profile=HostProfile::developer(), IEditorTransactionBackend *transactionBackend=nullptr) | |
| Editor property model. | |
| ~EditorPropertyModel () override | |
| Editor property model. | |
| const property_access::PropertySchema & | schema () const override |
| Schema. | |
| std::optional< eve::Value > | read (const std::string &path) const override |
| Reads . | |
| property_access::WriteResult | write (const std::string &path, const eve::Value &value) override |
| Writes . | |
| std::uint64_t | revision () const override |
| Revision. | |
| property_access::Subscription | subscribe (ChangeCallback callback) override |
| Subscribe. | |
| eve::Revision | targetRevision () const noexcept |
| Return the authoritative provider revision captured by this model. | |
| Result< void > | bind () |
| Bind to the provider's current revision and values. | |
| Result< void > | setTransactionBackend (IEditorTransactionBackend *backend) |
| Set the borrowed canonical transaction boundary. | |
| Result< TransactionId > | beginTransaction (std::string label="Edit property") |
| Begin an explicit property transaction. | |
| Result< EditorDryRunReport > | previewTransaction () |
| Validate pending property writes without changing the target. | |
| Result< TransactionReceipt > | commitTransaction () |
| Commit pending property writes and refresh observers after success. | |
| Result< void > | rollbackTransaction () |
| Discard pending property writes without publishing them. | |
| Result< TransactionReceipt > | retryTransaction () |
| Retry a retained failed commit. | |
| Result< TransactionReceipt > | undo () |
| Undo the latest committed property transaction. | |
| Result< TransactionReceipt > | redo () |
| Redo the latest undone property transaction. | |
| void | setEditSink (EditSink sink) |
| Install the legacy command sink; canonical code should inject a backend. | |
| Result< void > | refresh () |
| Re-read values and adopt the provider's current revision. | |
| Result< void > | rebase () |
| Explicit spelling for refreshing and rebasing this model. | |
Public 成员函数 继承自 eve::property_access::IPropertyAccess | |
| virtual | ~IPropertyAccess ()=default |
| I property access. | |
详细描述
Adapts command-backed editor properties to the shared MVVM contract.
The adapter never mutates a target directly. When a transaction backend is injected, a UI write is converted into a PropertyEditIntent and a DomainOperation, then staged and committed through that backend. The legacy sink remains a one-way compatibility facade and is used only when no transaction backend is configured.
This model is owner-thread only. Observer callbacks run synchronously after a complete snapshot is published; reentrant notifications are queued until the current notification batch completes.
在文件 EditorPropertyModel.h 第 38 行定义.
成员类型定义说明
◆ EditSink
| using eve::editor::EditorPropertyModel::EditSink = std::function<Result<void>(const PropertyEditIntent &)> |
在文件 EditorPropertyModel.h 第 40 行定义.
构造及析构函数说明
◆ EditorPropertyModel()
| eve::editor::EditorPropertyModel::EditorPropertyModel | ( | PropertySchema | schema, |
| SelectionSnapshot | selection, | ||
| const IPropertyProvider * | provider, | ||
| PropertyModelSurface | surface = PropertyModelSurface::Developer, |
||
| HostProfile | profile = HostProfile::developer(), |
||
| IEditorTransactionBackend * | transactionBackend = nullptr |
||
| ) |
Editor property model.
在文件 EditorPropertyModel.cpp 第 102 行定义.
引用了 bind() , 以及 eve::Result< T >::ok().
◆ ~EditorPropertyModel()
|
overridedefault |
Editor property model.
成员函数说明
◆ beginTransaction()
| Result< TransactionId > eve::editor::EditorPropertyModel::beginTransaction | ( | std::string | label = "Edit property" | ) |
Begin an explicit property transaction.
- 参数
-
label Human-readable history label.
- 返回
- The stable transaction identity, or a structured failure.
在文件 EditorPropertyModel.cpp 第 262 行定义.
引用了 eve::editor::IEditorTransactionBackend::active(), eve::editing::TransactionSpec::baseRevision, eve::editor::IEditorTransactionBackend::begin(), eve::UuidIdAdapter< Tag >::empty(), eve::Result< T >::failure(), eve::editing::TransactionSpec::id, label, eve::editing::TransactionSpec::label, eve::editing::TransactionSpec::mergeKey, eve::Result< T >::ok(), eve::Result< T >::status(), target, eve::editing::TransactionSpec::target , 以及 eve::detail::StrongUint64< Tag >::value().
◆ bind()
| Result< void > eve::editor::EditorPropertyModel::bind | ( | ) |
Bind to the provider's current revision and values.
- 返回
- Applied after an atomic refresh, or a structured failure.
在文件 EditorPropertyModel.cpp 第 402 行定义.
引用了 refresh().
被这些函数引用 EditorPropertyModel().
◆ commitTransaction()
| Result< TransactionReceipt > eve::editor::EditorPropertyModel::commitTransaction | ( | ) |
Commit pending property writes and refresh observers after success.
在文件 EditorPropertyModel.cpp 第 302 行定义.
引用了 eve::editor::IEditorTransactionBackend::commit(), eve::Result< T >::diagnostics(), eve::Result< T >::ok(), refresh(), eve::Result< T >::success() , 以及 eve::Result< T >::value().
◆ previewTransaction()
| Result< EditorDryRunReport > eve::editor::EditorPropertyModel::previewTransaction | ( | ) |
Validate pending property writes without changing the target.
在文件 EditorPropertyModel.cpp 第 292 行定义.
引用了 eve::Result< T >::ok() , 以及 eve::editor::IEditorTransactionBackend::preview().
◆ read()
|
overridevirtual |
Reads .
实现了 eve::property_access::IPropertyAccess.
在文件 EditorPropertyModel.cpp 第 135 行定义.
引用了 eve::property_access::PropertySchema::find(), found, path , 以及 eve::property_access::Value.
◆ rebase()
| Result< void > eve::editor::EditorPropertyModel::rebase | ( | ) |
Explicit spelling for refreshing and rebasing this model.
在文件 EditorPropertyModel.cpp 第 404 行定义.
引用了 refresh().
◆ redo()
| Result< TransactionReceipt > eve::editor::EditorPropertyModel::redo | ( | ) |
Redo the latest undone property transaction.
在文件 EditorPropertyModel.cpp 第 358 行定义.
引用了 eve::Result< T >::diagnostics(), eve::Result< T >::ok(), eve::editor::IEditorTransactionBackend::redo(), refresh(), eve::Result< T >::success() , 以及 eve::Result< T >::value().
◆ refresh()
| Result< void > eve::editor::EditorPropertyModel::refresh | ( | ) |
Re-read values and adopt the provider's current revision.
- 返回
- Applied after an atomic refresh; Conflict leaves the model unchanged when the provider changes during the read.
在文件 EditorPropertyModel.cpp 第 406 行定义.
引用了 eve::editor::IEditorTransactionBackend::active(), current, eve::Result< T >::failure(), first, found, eve::property_access::Missing, eve::property_access::Mixed, path, eve::property_access::PropertySchema::properties, eve::editing::IPropertyProvider::read() , 以及 eve::property_access::Value.
被这些函数引用 bind(), commitTransaction(), rebase(), redo(), retryTransaction(), undo() , 以及 write().
◆ retryTransaction()
| Result< TransactionReceipt > eve::editor::EditorPropertyModel::retryTransaction | ( | ) |
Retry a retained failed commit.
在文件 EditorPropertyModel.cpp 第 327 行定义.
引用了 eve::Result< T >::diagnostics(), eve::Result< T >::ok(), refresh(), eve::editor::IEditorTransactionBackend::retry(), eve::Result< T >::success() , 以及 eve::Result< T >::value().
◆ revision()
|
inlineoverridevirtual |
◆ rollbackTransaction()
| Result< void > eve::editor::EditorPropertyModel::rollbackTransaction | ( | ) |
Discard pending property writes without publishing them.
在文件 EditorPropertyModel.cpp 第 318 行定义.
引用了 eve::editor::IEditorTransactionBackend::discard() , 以及 eve::Result< T >::ok().
◆ schema()
|
inlineoverridevirtual |
◆ setEditSink()
|
inline |
Install the legacy command sink; canonical code should inject a backend.
在文件 EditorPropertyModel.h 第 97 行定义.
◆ setTransactionBackend()
| Result< void > eve::editor::EditorPropertyModel::setTransactionBackend | ( | IEditorTransactionBackend * | backend | ) |
Set the borrowed canonical transaction boundary.
- 参数
-
backend Backend that outlives this model, or null to detach it.
- 返回
- Applied when changed; rejected while that backend has pending work.
在文件 EditorPropertyModel.cpp 第 249 行定义.
◆ subscribe()
|
overridevirtual |
◆ targetRevision()
|
inlinenoexcept |
Return the authoritative provider revision captured by this model.
在文件 EditorPropertyModel.h 第 62 行定义.
◆ undo()
| Result< TransactionReceipt > eve::editor::EditorPropertyModel::undo | ( | ) |
Undo the latest committed property transaction.
在文件 EditorPropertyModel.cpp 第 343 行定义.
引用了 eve::Result< T >::diagnostics(), eve::Result< T >::ok(), refresh(), eve::Result< T >::success(), eve::editor::IEditorTransactionBackend::undo() , 以及 eve::Result< T >::value().
◆ write()
|
overridevirtual |
Writes .
实现了 eve::property_access::IPropertyAccess.
在文件 EditorPropertyModel.cpp 第 143 行定义.
引用了 eve::editor::IEditorTransactionBackend::active(), eve::editor::IEditorTransactionBackend::append(), eve::editing::TransactionSpec::baseRevision, eve::editor::IEditorTransactionBackend::begin(), eve::editor::IEditorTransactionBackend::commit(), eve::editor::IEditorTransactionBackend::discard(), eve::editor::RuntimePropertyPresenter::editIntent(), eve::editor::DeveloperPropertyPresenter::editIntent(), eve::UuidIdAdapter< Tag >::empty(), eve::editing::TransactionSpec::id, eve::editing::TransactionSpec::label, eve::editing::IPropertyProvider::makeSet(), eve::editing::TransactionSpec::mergeKey, eve::Result< T >::ok(), ok, operation, path, eve::editor::IEditorTransactionBackend::preview(), refresh(), eve::property_access::WriteResult::reject(), eve::editor::Runtime, started, eve::property_access::WriteResult::success(), eve::editing::TransactionSpec::target, eve::editor::toEditorValue(), eve::Result< T >::value(), eve::UuidIdAdapter< Tag >::value(), eve::detail::StrongUint64< Tag >::value() , 以及 value.
该类的文档由以下文件生成:
- src/modules/editor/EditorPropertyModel.h
- src/modules/editor/EditorPropertyModel.cpp
Public 类型 继承自