interface to implement to get an UndoMemento for the object implementing this interface to get its current state. More...
#include <iundo.h>
Public Member Functions | |
virtual | ~Undoable () |
virtual UndoMemento * | exportState () const =0 |
export the current state via UndoMemento | |
virtual void | importState (const UndoMemento *state)=0 |
restore a previously stored memento |
interface to implement to get an UndoMemento for the object implementing this interface to get its current state.
greebo: This is the abstract base class for an Undoable object. Derive from this class if your instance/object should be Undoable.
The exportState method has to allocate a new UndoMemento with all the necessary object data and return its pointer, so it can be referenced to later.
The importState() method should re-import the values saved in the UndoMemento (could be named restoreFromMemento() as well).
Definition at line 66 of file iundo.h.
virtual UndoMemento* Undoable::exportState | ( | ) | const [pure virtual] |
export the current state via UndoMemento
virtual void Undoable::importState | ( | const UndoMemento * | state | ) | [pure virtual] |