载入中...
搜索中...
未找到
EditorPropertyModel.cpp
浏览该文件的文档.
25 return property_access::WriteResult::reject(std::move(fallbackCode), std::move(fallbackMessage));
86 return eve::editing::failed<void>(EditorStatus::Conflict, RuleId("editor.property.revision-conflict"),
126 if (surface_ == PropertyModelSurface::Runtime && !profile_.hasFeatures(HostFeature::RuntimeWorld)) return;
128 if (surface_ == PropertyModelSurface::Runtime && (!hasPropertyFlag(property.flags, PropertyFlag::Runtime) ||
138 if (found == cachedProperties_.end() || found->second.state != property_access::PropertyChangeState::Value)
143property_access::WriteResult EditorPropertyModel::write(const std::string& path, const eve::Value& value) {
144 if (!provider_) return property_access::WriteResult::reject("editor.property.provider", "No property provider");
147 return writeFailure(revisionCheck, "editor.property.revision", "Property revision is unavailable");
156 return presenter.editIntent(editorSchema_, selection_, PropertyPath(path), editorValue, profile_);
171 return property_access::WriteResult::reject("editor.property.target", "Property operation has no target");
188 return writeFailure(begun, "editor.property.transaction.begin", "Could not begin property transaction");
200 return writeFailure(appended, "editor.property.transaction.append", "Could not stage property operation");
223 return writeFailure(committed, "editor.property.transaction.commit", "Property transaction commit failed");
232 if (!sink_) return property_access::WriteResult::reject("editor.property.sink", "No command sink is connected");
238 return writeFailure(sinkRevisionCheck, "editor.property.revision", "Property revision is unavailable");
255 return eve::editing::failed<void>(EditorStatus::Conflict, RuleId("editor.property.backend-active"),
268 return eve::editing::failed<TransactionId>(EditorStatus::Conflict, RuleId("editor.property.transaction-active"),
272 return eve::editing::failed<TransactionId>(EditorStatus::Rejected, RuleId("editor.property.target"),
285 return eve::editing::failed<TransactionId>(EditorStatus::Failed, RuleId("editor.property.transaction-id"),
320 return eve::editing::failed<void>(EditorStatus::Unsupported, RuleId("editor.property.transaction-backend"),
379 std::erase_if(state->entries, [id](const ObserverState::Entry& entry) { return entry.id == id; });
385 return eve::editing::failed<eve::Revision>(EditorStatus::Unsupported, RuleId("editor.property.provider"),
398 if (current.value() != targetRevision_) return externalRevisionConflict(targetRevision_, current.value());
408 return eve::editing::failed<void>(EditorStatus::Unsupported, RuleId("editor.property.provider"),
411 return eve::editing::failed<void>(EditorStatus::Conflict, RuleId("editor.property.active-transaction"),
432 case PropertyReadState::Mixed: cached.state = property_access::PropertyChangeState::Mixed; break;
433 case PropertyReadState::Missing: cached.state = property_access::PropertyChangeState::Missing; break;
const T & value() const &
Borrow the value from a const lvalue after checking success.
Definition Result.h:308
const std::vector< Diagnostic > & diagnostics() const noexcept
Inspect all diagnostics; this counts as checking the Result.
Definition Result.h:283
bool ok() const noexcept
Whether this result represents a non-failure outcome.
Definition Result.h:255
const Status & status() const noexcept
Inspect the structured operation status.
Definition Result.h:269
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Move-only RAII token that owns one observer registration.
Definition Subscription.h:27
UUID-backed identifier adapter for legacy textual boundaries.
Definition Identity.h:314
static UuidIdAdapter fromUuid(Uuid value)
Builds an adapter from an explicit canonical UUID.
Definition Identity.h:343
const std::string & value() const noexcept
Returns the exact legacy or canonical compatibility spelling.
Definition Identity.h:362
bool empty() const noexcept
True when no compatibility spelling has been assigned.
Definition Identity.h:374
std::optional< PersistentId > generate() const
Generates a UUIDv7 using the injected clock.
Definition Identity.cpp:80
constexpr std::uint64_t value() const noexcept
Returns the underlying value at an explicit protocol boundary.
Definition StrongUint64.h:26
UI-independent property access for an immutable selection snapshot.
Definition EditingProperty.h:139
virtual Result< DomainOperation > makeSet(const SelectionSnapshot &selection, const PropertyPath &path, const Value &value, PropertySetMode mode) const =0
Make set.
virtual PropertyReadResult read(const SelectionSnapshot &selection, const PropertyPath &path) const =0
Reads read.
virtual eve::Result< eve::Revision > currentRevision(const SelectionSnapshot &selection) const
Current revision.
Definition EditingProperty.h:146
Deterministic owning value tree shared by authoring hosts.
Definition EditingValue.h:19
Shared presenter logic that exposes developer-oriented property rows.
Definition EditorPropertyPresenter.h:32
Result< PropertyEditIntent > editIntent(const PropertySchema &schema, const SelectionSnapshot &selection, const PropertyPath &path, const EditorValue &value, PropertySetMode mode=PropertySetMode::Absolute) const
Validate a candidate and emit a command payload without mutating the provider.
Definition EditorPropertyPresenter.cpp:54
property_access::WriteResult write(const std::string &path, const eve::Value &value) override
Writes .
Definition EditorPropertyModel.cpp:143
Result< TransactionReceipt > undo()
Undo the latest committed property transaction.
Definition EditorPropertyModel.cpp:343
Result< void > setTransactionBackend(IEditorTransactionBackend *backend)
Set the borrowed canonical transaction boundary.
Definition EditorPropertyModel.cpp:249
property_access::Subscription subscribe(ChangeCallback callback) override
Subscribe.
Definition EditorPropertyModel.cpp:373
Result< void > rollbackTransaction()
Discard pending property writes without publishing them.
Definition EditorPropertyModel.cpp:318
~EditorPropertyModel() override
Editor property model.
Result< EditorDryRunReport > previewTransaction()
Validate pending property writes without changing the target.
Definition EditorPropertyModel.cpp:292
Result< TransactionReceipt > redo()
Redo the latest undone property transaction.
Definition EditorPropertyModel.cpp:358
EditorPropertyModel(PropertySchema schema, SelectionSnapshot selection, const IPropertyProvider *provider, PropertyModelSurface surface=PropertyModelSurface::Developer, HostProfile profile=HostProfile::developer(), IEditorTransactionBackend *transactionBackend=nullptr)
Editor property model.
Definition EditorPropertyModel.cpp:102
Result< TransactionReceipt > commitTransaction()
Commit pending property writes and refresh observers after success.
Definition EditorPropertyModel.cpp:302
Result< TransactionId > beginTransaction(std::string label="Edit property")
Begin an explicit property transaction.
Definition EditorPropertyModel.cpp:262
Result< TransactionReceipt > retryTransaction()
Retry a retained failed commit.
Definition EditorPropertyModel.cpp:327
Result< void > refresh()
Re-read values and adopt the provider's current revision.
Definition EditorPropertyModel.cpp:406
Result< void > bind()
Bind to the provider's current revision and values.
Definition EditorPropertyModel.cpp:402
Result< void > rebase()
Explicit spelling for refreshing and rebasing this model.
Definition EditorPropertyModel.cpp:404
std::optional< eve::Value > read(const std::string &path) const override
Reads .
Definition EditorPropertyModel.cpp:135
Upper capability boundary for one editor host.
Definition EditorHostProfile.h:51
Transaction boundary consumed by editor property and other UI models.
Definition EditorTransactionService.h:17
virtual Result< TransactionReceipt > redo()=0
Reapply the latest compensated transaction.
virtual Result< void > discard()=0
Discard pending work after reverting any provisional preview.
virtual Result< TransactionReceipt > undo()=0
Compensate the latest committed transaction.
virtual Result< TransactionReceipt > commit()=0
Publish the pending transaction and retain it for undo.
virtual Result< TransactionReceipt > retry()=0
Retry a failed commit while retaining its original operation list.
virtual Result< void > append(DomainOperation operation)=0
Append a serializable operation to the pending transaction.
virtual bool active() const noexcept=0
Whether a transaction is currently pending.
virtual Result< EditorDryRunReport > preview()=0
Validate the pending transaction without publishing target state.
virtual Result< TransactionId > begin(TransactionSpec specification)=0
Begin an explicit transaction without mutating its target.
Shared presenter logic that exposes only runtime-safe property rows.
Definition EditorPropertyPresenter.h:44
Result< PropertyEditIntent > editIntent(const PropertySchema &schema, const SelectionSnapshot &selection, const PropertyPath &path, const EditorValue &value, const HostProfile &profile, PropertySetMode mode=PropertySetMode::Absolute) const
Validate a runtime-visible candidate and emit the same command payload as developer UI.
Definition EditorPropertyPresenter.cpp:78
std::function< void(const PropertyChange &)> ChangeCallback
Definition PropertyAccess.h:153
RuleId diagnosticRule(const Diagnostic &diagnostic)
Return the projected editing rule, or an empty RuleId when absent.
Definition EditingResult.h:34
Definition ActionPreviewController.cpp:6
EditorValue toEditorValue(const eve::Value &value)
Compatibility spelling for conversion into the authoring value tree.
Definition EditorProperty.h:29
eve::editing::SelectionItem SelectionItem
Stable item stored in a selection snapshot.
Definition EditorSelection.h:22
eve::editing::SelectionSnapshot SelectionSnapshot
Immutable multi-selection captured for property and command work.
Definition EditorSelection.h:25
@ RuntimeWorld
PropertyModelSurface
Property visibility/permission surface exposed by an editor model.
Definition EditorPropertyModel.h:23
eve::Subscription Subscription
Compatibility alias for the common observer lifetime token.
Definition PropertyAccess.h:142
@ Pending
@ NotFound
@ NoOp
@ Applied
@ Cancelled
@ Unsupported
@ Rejected
@ Failed
@ Conflict
detail::StrongUint64< detail::RevisionTag > Revision
Monotonic content/state revision used for optimistic-concurrency checks.
Definition Revision.h:13
Definition Container.h:602
ChangeCallback callback
Definition EditorPropertyModel.cpp:96
std::vector< Entry > entries
Definition EditorPropertyModel.cpp:99
std::uint64_t nextId
Definition EditorPropertyModel.cpp:98
Immutable notification emitted after a model property changes.
Definition PropertyAccess.h:128
One stable property description consumed by any UI shell.
Definition PropertyAccess.h:72
eve::OptionalRef< const PropertyDescriptor > find(const std::string &path) const
Find a property by stable path, or an empty immediate borrow.
Definition PropertyAccess.cpp:9
std::vector< PropertyDescriptor > properties
Definition PropertyAccess.h:89
Result of a model write, including a stable diagnostic code.
Definition PropertyAccess.h:96
static WriteResult reject(std::string code, std::string message)
Reject.
Definition PropertyAccess.h:104