载入中...
搜索中...
未找到
eve::editor::EditorPropertyModel类 参考final

Adapts command-backed editor properties to the shared MVVM contract. 更多...

#include <EditorPropertyModel.h>

类 eve::editor::EditorPropertyModel 继承关系图:
eve::property_access::IPropertyAccess

类

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

在文件 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()

eve::editor::EditorPropertyModel::~EditorPropertyModel ( )
overridedefault

Editor property model.

成员函数说明

◆ beginTransaction()

◆ 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()

std::optional< eve::Value > eve::editor::EditorPropertyModel::read ( const std::string &  path) const
overridevirtual

◆ 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 ( )

◆ 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 ( )

◆ revision()

std::uint64_t eve::editor::EditorPropertyModel::revision ( ) const
inlineoverridevirtual

Revision.

实现了 eve::property_access::IPropertyAccess.

在文件 EditorPropertyModel.h 第 57 行定义.

◆ 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()

const property_access::PropertySchema & eve::editor::EditorPropertyModel::schema ( ) const
inlineoverridevirtual

Schema.

实现了 eve::property_access::IPropertyAccess.

在文件 EditorPropertyModel.h 第 51 行定义.

◆ setEditSink()

void eve::editor::EditorPropertyModel::setEditSink ( EditSink  sink)
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.

参数
backendBackend that outlives this model, or null to detach it.
返回
Applied when changed; rejected while that backend has pending work.

在文件 EditorPropertyModel.cpp 第 249 行定义.

引用了 eve::editor::IEditorTransactionBackend::active().

◆ subscribe()

property_access::Subscription eve::editor::EditorPropertyModel::subscribe ( ChangeCallback  callback)
overridevirtual

Subscribe.

实现了 eve::property_access::IPropertyAccess.

在文件 EditorPropertyModel.cpp 第 373 行定义.

引用了 callback, id , 以及 state.

◆ targetRevision()

eve::Revision eve::editor::EditorPropertyModel::targetRevision ( ) const
inlinenoexcept

Return the authoritative provider revision captured by this model.

在文件 EditorPropertyModel.h 第 62 行定义.

◆ undo()

Result< TransactionReceipt > eve::editor::EditorPropertyModel::undo ( )

◆ write()


该类的文档由以下文件生成: