7#include "absl/status/status.h"
28 return absl::FailedPreconditionError(
"Nothing to undo");
32 auto status = action->Undo();
39 return absl::OkStatus();
44 return absl::FailedPreconditionError(
"Nothing to redo");
48 auto status = action->Redo();
55 return absl::OkStatus();
void Push(std::unique_ptr< UndoAction > action)
absl::Status Redo()
Redo the top action. Returns error if stack is empty.
std::string GetRedoDescription() const
Description of the action that would be redone (for UI)
std::deque< std::unique_ptr< UndoAction > > redo_stack_
std::string GetUndoDescription() const
Description of the action that would be undone (for UI)
absl::Status Undo()
Undo the top action. Returns error if stack is empty.
std::deque< std::unique_ptr< UndoAction > > undo_stack_