载入中...
搜索中...
未找到
SocialDocument.cpp
浏览该文件的文档.
26 return eve::editing::failed<SocialEntityRecord>(EditorStatus::Rejected, RuleId("editor.social.invalid-entity"),
32 {"id", e.id.value()}, {"source", e.source.value()}, {"target", e.target.value()}, {"kind", e.kind},
42 const auto *id = str("id"), *source = str("source"), *target = str("target"), *kind = str("kind"),
54DomainOperation op(const char* t, const char* inverse, const std::string& target, EditorValue payload, EditorValue undo,
97 return eve::editing::failed<void>(v.code(), RuleId("editor.social.edge-payload"), "Invalid edge payload");
99 return eve::editing::failed<void>(EditorStatus::Conflict, RuleId("editor.social.missing-endpoint"),
105 return eve::editing::failed<void>(EditorStatus::Rejected, RuleId("editor.social.delete-payload"),
112 return eve::editing::failed<void>(EditorStatus::Conflict, RuleId("editor.social.entity-in-use"),
116 return eve::editing::failed<void>(EditorStatus::NotFound, RuleId("editor.social.entity-not-found"),
119 return eve::editing::failed<void>(EditorStatus::NotFound, RuleId("editor.social.edge-not-found"),
131Result<void> SocialDocumentTarget::commitDomainState(std::unique_ptr<IDomainOperationTarget> candidate) {
139std::vector<SocialEntityRecord> SocialDocumentTarget::entities() const { return values(entities_); }
143 return eve::editing::failed<DomainOperation>(EditorStatus::Rejected, RuleId("editor.social.invalid-entity"),
147 op("social.entity.set.v1", f == entities_.end() ? "social.entity.delete.v1" : "social.entity.set.v1", id_,
153 return eve::editing::failed<DomainOperation>(EditorStatus::NotFound, RuleId("editor.social.entity-not-found"),
158 return eve::editing::failed<DomainOperation>(EditorStatus::Conflict, RuleId("editor.social.entity-in-use"),
166 return eve::editing::failed<DomainOperation>(EditorStatus::Rejected, RuleId("editor.social.invalid-edge"),
169 return eve::editing::failed<DomainOperation>(EditorStatus::Conflict, RuleId("editor.social.missing-endpoint"),
172 if (id != e.id && current.source == e.source && current.target == e.target && current.kind == e.kind &&
174 return eve::editing::failed<DomainOperation>(EditorStatus::Conflict, RuleId("editor.social.duplicate-edge"),
178 op("social.edge.set.v1", f == edges_.end() ? "social.edge.delete.v1" : "social.edge.set.v1", id_, edgeValue(e),
184 return eve::editing::failed<DomainOperation>(EditorStatus::NotFound, RuleId("editor.social.edge-not-found"),
238 return eve::editing::failed<void>(EditorStatus::Rejected, RuleId("editor.social.snapshot-entity"),
244 return eve::editing::failed<void>(EditorStatus::Rejected, RuleId("editor.social.snapshot-edge"),
249 return eve::editing::failed<void>(EditorStatus::Rejected, RuleId("editor.social.snapshot-invariant"),
UUID-backed identifier adapter for legacy textual boundaries.
Definition Identity.h:314
const std::string & value() const noexcept
Returns the exact legacy or canonical compatibility spelling.
Definition Identity.h:362
void bumpRevision()
Advance the revision without touching the dirty region.
Definition EditableTarget.h:179
Revision revisionValue() const noexcept
Return the revision as the shared protocol revision type.
Definition EditableTarget.h:169
void widenDirty()
Mark an unknown area dirty without advancing the revision.
Definition EditableTarget.h:177
eve::OptionalRef< C > capability()
Query a capability through its interface-owned stable identity.
Definition EditableTarget.h:82
Deterministic owning value tree shared by authoring hosts.
Definition EditingValue.h:19
UI-neutral revisioned social graph authoring document.
Definition SocialDocument.h:56
Result< DomainOperation > makeSetEntity(const SocialEntityRecord &entity) const
Plan reversible entity creation or replacement.
Definition SocialDocument.cpp:141
Result< void > loadSnapshot(const EditorValue &snapshot)
Atomically load a validated graph snapshot.
Definition SocialDocument.cpp:226
std::vector< EditorDiagnostic > validate() const
Validate references, uniqueness constraints and finite weights.
Definition SocialDocument.cpp:189
Result< DomainOperation > makeDeleteEntity(const StableId &id) const
Plan deletion of an entity and reject it while edges reference it.
Definition SocialDocument.cpp:150
Result< DomainOperation > makeDeleteEdge(const StableId &id) const
Plan reversible edge deletion.
Definition SocialDocument.cpp:181
Result< void > commitDomainState(std::unique_ptr< IDomainOperationTarget > candidate) override
Commits domain state.
Definition SocialDocument.cpp:131
Result< void > applyDomainOperation(const DomainOperation &operation) override
Applies domain operation.
Definition SocialDocument.cpp:84
std::vector< SocialEntityRecord > entities() const
Enumerate entities in stable order.
Definition SocialDocument.cpp:139
EditorValue snapshotValue() const
Capture deterministic schema-version-one graph content.
Definition SocialDocument.cpp:213
std::vector< SocialEdgeRecord > edges() const
Enumerate edges in stable order.
Definition SocialDocument.cpp:140
std::unique_ptr< IDomainOperationTarget > cloneDomainState() const override
Clones domain state.
Definition SocialDocument.cpp:128
void * queryCapability(const CapabilityId &capability) override
Query an optional target capability.
Definition SocialDocument.cpp:81
Result< DomainOperation > makeSetEdge(const SocialEdgeRecord &edge) const
Plan reversible edge creation or replacement.
Definition SocialDocument.cpp:164
Diagnostic ruleDiagnostic(eve::DiagnosticCode code, RuleId rule, DiagnosticSeverity severity, std::string message)
Build a common diagnostic carrying an open editing rule identity.
Definition EditingResult.h:25
Definition SocialDocument.cpp:7
@ NotFound
@ Conflict
Definition Container.h:602
Stable discovery metadata exposed by every editable target.
Definition EditableTarget.h:39
Directed ownership, control, assignment or weighted relation edge.
Definition SocialDocument.h:43
Stable social-graph entity metadata for graph presenters.
Definition SocialDocument.h:36