Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

UndoCommand Class Reference

#include <Undoable.h>

List of all members.

Public Member Functions

 UndoCommand ()
 ~UndoCommand ()
 UndoCommand (UndoItem &ui)
 UndoCommand (Undoable &u)
 UndoCommand (const UndoCommand &rhs)
UndoCommandoperator= (UndoCommand &rhs)
void Undo ()
void Redo ()


Constructor & Destructor Documentation

UndoCommand::UndoCommand  )  [inline]
 

Definition at line 63 of file Undoable.h.

00063 {}

UndoCommand::~UndoCommand  )  [inline]
 

Definition at line 64 of file Undoable.h.

00064 {}

UndoCommand::UndoCommand UndoItem ui  )  [inline]
 

Definition at line 67 of file Undoable.h.

00067 { this->push_back(ui); }

UndoCommand::UndoCommand Undoable u  )  [inline]
 

Definition at line 68 of file Undoable.h.

00068 { this->push_back(UndoItem(u)); }

UndoCommand::UndoCommand const UndoCommand rhs  )  [inline]
 

Definition at line 71 of file Undoable.h.

00071                                         : std::list<UndoItem>() {
00072         this->insert(this->end(),rhs.begin(),rhs.end());
00073         UndoCommand& ncrhs = const_cast<UndoCommand&>(rhs);
00074         ncrhs.erase(ncrhs.begin(),ncrhs.end());
00075       }


Member Function Documentation

UndoCommand& UndoCommand::operator= UndoCommand rhs  )  [inline]
 

Definition at line 77 of file Undoable.h.

00077                                              {
00078         if (this == &rhs) return rhs;
00079         this->insert(this->end(),rhs.begin(),rhs.end());
00080         rhs.erase(rhs.begin(),rhs.end());
00081         return *this;
00082     }

void UndoCommand::Redo  )  [inline]
 

Definition at line 92 of file Undoable.h.

References UndoMemento.

Referenced by UndoHistory::Redo().

00092                 {
00093         std::list<UndoItem>::iterator i;
00094         for (i = begin(); i != end(); ++i) {
00095             UndoMemento m = i->undoable.GetMemento();
00096             i->memento();
00097             i->memento = m;
00098         }
00099     }

void UndoCommand::Undo  )  [inline]
 

Definition at line 84 of file Undoable.h.

References UndoMemento.

Referenced by UndoHistory::Undo().

00084                 {
00085         std::list<UndoItem>::reverse_iterator i;
00086         for (i = rbegin(); i != rend(); ++i) {
00087             UndoMemento m = i->undoable.GetMemento();
00088             i->memento();
00089             i->memento = m;
00090         }
00091     }


The documentation for this class was generated from the following file:
Generated on Mon Feb 15 11:10:28 2010 for loon by  doxygen 1.3.9.1