载入中...
搜索中...
未找到
PropertyAccess.h
浏览该文件的文档.
55 return static_cast<PropertyFlag>(static_cast<std::uint64_t>(left) | static_cast<std::uint64_t>(right));
59 return static_cast<PropertyFlag>(static_cast<std::uint64_t>(left) & static_cast<std::uint64_t>(right));
112 StatusCode::Rejected, Diagnostic::error(code, std::move(message), {}, std::move(details), "property_access")));
153[[nodiscard]] EVENGINE_API_FOUNDATION Result<void> validatePropertyValue(const PropertyDescriptor &property,
Vocabulary aliases for nullable and checked borrowed references.
#define EVENGINE_API_FOUNDATION_INLINE
仅供"只有内联成员"的类型使用的组宏:拥有者 dllexport,消费方不导入。
Definition Export.h:170
Move-only, checked operation results for the common layer.
Owning, renderer-independent dynamic values.
A structured explanation of a failed, degraded, or noteworthy result.
Definition Diagnostic.h:94
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
const DiagnosticDetails & details() const noexcept
Structured context in insertion order.
Definition Diagnostic.h:151
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
static Status failure(StatusCode code, Diagnostic diagnostic)
Construct a failed status with one diagnostic.
Definition Status.cpp:28
Move-only RAII token that owns one observer registration.
Definition Subscription.h:27
Renderer- and transaction-independent MVVM property surface.
Definition PropertyAccess.h:183
virtual const PropertySchema & schema() const =0
Return the stable schema exposed by this model.
virtual std::optional< Value > read(const std::string &path) const =0
Read a property value, or nullopt when it is absent.
virtual Result< void > write(const std::string &path, const Value &value)=0
Request a two-way binding write.
std::function< void(const PropertyChange &)> ChangeCallback
Definition PropertyAccess.h:185
virtual Subscription subscribe(ChangeCallback callback)=0
Observe changes until the returned token is destroyed.
virtual ~IPropertyAccess()=default
I property access.
virtual std::uint64_t revision() const =0
Monotonic revision incremented after observable changes.
Definition PropertyAccess.cpp:7
constexpr const char * kRuleDiagnosticDetail
Reserved DiagnosticDetails key carrying a stable property-access rule id.
Definition PropertyAccess.h:98
std::string writeRule(const Result< void > &result)
Return the primary rule id from a write/validation result.
Definition PropertyAccess.h:135
Result< void > rejected(std::string rule, std::string message, DiagnosticCode code=DiagnosticCode::PreconditionViolation)
Build a rejected write/validation result with a stable rule string.
Definition PropertyAccess.h:107
std::string_view diagnosticRule(const Diagnostic &diagnostic)
Return the projected property-access rule id, or empty when absent.
Definition PropertyAccess.h:125
constexpr bool hasFlag(PropertyFlag value, PropertyFlag flag)
True when flag.
Definition PropertyAccess.h:62
PropertyChangeState
Availability of a property in an immutable model snapshot.
Definition PropertyAccess.h:157
@ EditorOnly
PropertyKind
Semantic property kind used by renderer-independent presenters.
Definition PropertyAccess.h:21
@ ReadOnlyText
std::vector< DiagnosticDetail > DiagnosticDetails
Owning collection of diagnostic details with stable insertion order.
Definition Diagnostic.h:88
@ PreconditionViolation
@ Rejected
std::optional< std::reference_wrapper< T > > OptionalRef
Optional borrowed reference; it does not extend T's lifetime.
Definition BorrowedRef.h:24
Numeric editing metadata independent of a slider or spin-box widget.
Definition PropertyAccess.h:65
std::optional< double > minimum
Definition PropertyAccess.h:66
std::optional< double > maximum
Definition PropertyAccess.h:67
std::optional< double > step
Definition PropertyAccess.h:68
Immutable notification emitted after a model property changes.
Definition PropertyAccess.h:160
One stable property description consumed by any UI shell.
Definition PropertyAccess.h:74
NumericMetadata numeric
Definition PropertyAccess.h:82
Value defaultValue
Definition PropertyAccess.h:81
std::string description
Definition PropertyAccess.h:77
std::string displayName
Definition PropertyAccess.h:76
std::string category
Definition PropertyAccess.h:78
std::vector< std::string > choices
Definition PropertyAccess.h:83
std::string presenterHint
Definition PropertyAccess.h:84
Versioned schema for one view model or editable target.
Definition PropertyAccess.h:88
std::vector< PropertyDescriptor > properties
Definition PropertyAccess.h:91