UndoHistory Class Reference

#include <Undoable.h>

List of all members.

Public Member Functions

 UndoHistory ()
 ~UndoHistory ()
void Store (UndoCommand uc)
bool Undo (void)
bool Redo (void)
void Clear ()

Private Attributes

std::list< UndoCommandfUndoList
std::list< UndoCommandfRedoList

Detailed Description

Definition at line 113 of file Undoable.h.


Constructor & Destructor Documentation

UndoHistory::UndoHistory (  )  [inline]

Definition at line 116 of file Undoable.h.

00116 {}

UndoHistory::~UndoHistory (  )  [inline]

Definition at line 117 of file Undoable.h.

00117 {}


Member Function Documentation

void UndoHistory::Clear ( void   )  [inline]

Definition at line 139 of file Undoable.h.

References fUndoList.

00139                  {
00140         fUndoList.clear();
00141         fUndoList.clear();
00142     }

bool UndoHistory::Redo ( void   )  [inline]

Definition at line 130 of file Undoable.h.

References fRedoList, fUndoList, and UndoCommand::Redo().

Referenced by main(), test1(), and test2().

00130                     {
00131         if (fRedoList.size() == 0) return false;
00132         UndoCommand uc = fRedoList.back();
00133         fRedoList.pop_back();
00134         uc.Redo();
00135         fUndoList.push_back(uc);
00136         return true;
00137     }

void UndoHistory::Store ( UndoCommand  uc  )  [inline]

Definition at line 119 of file Undoable.h.

References fUndoList.

Referenced by set_pad_in_history(), test1(), and test2().

00120         { fUndoList.push_back(uc); }

bool UndoHistory::Undo ( void   )  [inline]

Definition at line 122 of file Undoable.h.

References fRedoList, fUndoList, and UndoCommand::Undo().

Referenced by main(), test1(), and test2().

00122                     {
00123         if (fUndoList.size() == 0) return false;
00124         UndoCommand uc = fUndoList.back();
00125         fUndoList.pop_back();
00126         uc.Undo();
00127         fRedoList.push_back(uc);
00128         return true;
00129     }


Member Data Documentation

std::list<UndoCommand> UndoHistory::fRedoList [private]

Definition at line 146 of file Undoable.h.

Referenced by Redo(), and Undo().

std::list<UndoCommand> UndoHistory::fUndoList [private]

Definition at line 145 of file Undoable.h.

Referenced by Clear(), Redo(), Store(), and Undo().


The documentation for this class was generated from the following file:

Generated on 24 Jul 2018 for loon by  doxygen 1.6.1