#include <StackableDelta.h>
Inheritance diagram for Document::StackableDelta:
Public Member Functions | |
StackableDelta () | |
virtual | ~StackableDelta () |
virtual void | apply (Track::Track &track)=0 |
Create a stack of DocumentDeltas. | |
void | unapply (Track::Track &track) |
Undo the stack of DocumentDeltas created in apply(). | |
Protected Member Functions | |
void | add_to_stack (boost::shared_ptr< DocumentDelta > delta, Track::Track &track) |
Apply and record a change. | |
Private Attributes | |
std::vector< boost::shared_ptr< DocumentDelta > > | delta_stack |
The DocumentDeltas currently ready to be undone, last first. |
You can stack document deltas up in the apply() function using add_to_stack(delta, track).
Definition at line 28 of file StackableDelta.h.
Document::StackableDelta::StackableDelta | ( | ) |
Definition at line 17 of file StackableDelta.cpp.
Document::StackableDelta::~StackableDelta | ( | ) | [virtual] |
Definition at line 21 of file StackableDelta.cpp.
void Document::StackableDelta::add_to_stack | ( | boost::shared_ptr< DocumentDelta > | delta, | |
Track::Track & | track | |||
) | [protected] |
Apply and record a change.
This will perform the apply command for the DocumentDelta you pass in, and record it so that it can be undone later.
delta | shared pointer to the DocumentDelta to apply. | |
track | The Track::Track to apply it to. |
Definition at line 34 of file StackableDelta.cpp.
virtual void Document::StackableDelta::apply | ( | Track::Track & | track | ) | [pure virtual] |
Create a stack of DocumentDeltas.
Use only add_to_stack() to change the track, so that changes can be reversed.
track | The track to apply the changes to. |
Implements Document::DocumentDelta.
Implemented in Document::ChangeVertexSegmentDelta, Document::ClearVertexDelta, Document::RemoveVertexDelta, and Document::SetStartPositionsDelta.
void Document::StackableDelta::unapply | ( | Track::Track & | track | ) | [virtual] |
Undo the stack of DocumentDeltas created in apply().
Implements Document::DocumentDelta.
Definition at line 25 of file StackableDelta.cpp.
std::vector<boost::shared_ptr<DocumentDelta> > Document::StackableDelta::delta_stack [private] |
The DocumentDeltas currently ready to be undone, last first.
Definition at line 54 of file StackableDelta.h.
Generated at Mon Sep 6 00:41:17 2010 by Doxygen version 1.4.7 for Racer version svn335.