Stack of undoable modifications. More...
Public Member Functions
|Save current state. |
|void||record (UndoBase *event)|
|Record a modification for later rewinding. |
Protected Member Functions
|void||restore (unsigned pos)|
|Undo events in reverse order up to a certain state. |
|std::vector< UndoBase * >||events|
|A stack of undoable events. |
|The UndoState may initiate rewinding of modifications. |
Stack of undoable modifications.
Whenever a class performs some local modification that needs to be unwound when the current branch is left, this modification can be registered with the UndoManager. In this way, no class has to care for properly cleaning up all modifications in all possible cases. It registers the undo event when it performs the modification in the first place, and after that it can forget about it. The branching code will ask the undo manager to rewind modifications in reverse order at appropriate times.
|void bande::UndoManager::record||(||UndoBase *||event||)||
Record a modification for later rewinding.
The undo manager will ensure the objects will get deleted eventually.
|event||an undoable object describing the modification.|