载入中...
搜索中...
未找到
EditorTransactions.cpp
浏览该文件的文档.
2
3namespace eve::editor {
4
6 return consumer_.begin(std::move(specification));
7}
8
10 return consumer_.beginLegacy(std::move(label));
11}
12
13eve::Result<void> EditorTransactions::append(std::unique_ptr<IEditCommand> command) {
14 return consumer_.appendPreview(std::move(command));
15}
16
18
20
22
24
25bool EditorTransactions::begin(const std::string &name) {
26 auto result = beginTransaction(name);
27 return result.ok();
28}
29bool EditorTransactions::execute(std::unique_ptr<IEditCommand> command) {
30 auto result = append(std::move(command));
31 return result.ok();
32}
34 auto result = commitTransaction();
35 return result.ok();
36}
38 auto result = rollbackTransaction();
39 return result.ok();
40}
42 auto result = undoTransaction();
43 return result.ok();
44}
46 auto result = redoTransaction();
47 return result.ok();
48}
49void EditorTransactions::clear() { consumer_.clear(); }
50
51} // namespace eve::editor
std::string label
std::string name
Move-only operation result carrying either a value or Status.
Definition Result.h:155
void clear()
Clears active work and editor-owned undo/redo history.
eve::Result< TransactionId > begin(TransactionSpec specification)
Begins a transaction with an explicit stable editor identifier.
eve::Result< EditorTransactionRecord > undo()
Compensates the latest editor-owned commit and moves it to redo history.
eve::Result< void > rollback()
Discards the active transaction and any unpublished preview.
eve::Result< EditorTransactionRecord > commit()
Commits the active editor participant set through Coordinator.
eve::Result< void > appendPreview(std::unique_ptr< IEditCommand > command)
Compatibility-only append that applies a command as an editor preview.
eve::Result< TransactionId > beginLegacy(std::string label)
Begins a compatibility command transaction with an allocated identifier.
eve::Result< EditorTransactionRecord > redo()
Re-executes the latest compensated editor-owned transaction.
eve::Result< TransactionId > beginTransaction(TransactionSpec specification)
Begin a canonical checked transaction.
eve::Result< void > rollbackTransaction()
Discard the active transaction and restore its preview state.
eve::Result< void > append(std::unique_ptr< IEditCommand > command)
Stage and preview one command without discarding diagnostics.
eve::Result< EditorTransactionRecord > commitTransaction()
Commit the active transaction and return its complete record.
bool undo()
Compatibility-only boolean projection of undoTransaction().
bool commit()
Compatibility-only boolean projection of commitTransaction().
bool rollback()
Compatibility-only boolean projection of rollbackTransaction().
eve::Result< EditorTransactionRecord > undoTransaction()
Compensate the latest committed transaction.
bool redo()
Compatibility-only boolean projection of redoTransaction().
bool begin(const std::string &name)
Compatibility-only boolean facade over beginTransaction(label).
eve::Result< EditorTransactionRecord > redoTransaction()
Reapply the latest compensated transaction.
bool execute(std::unique_ptr< IEditCommand > command)
Compatibility-only boolean facade over append().
TransactionSpec public API.