Document::StackableDelta Class Reference

A DocumentDelta that will combine the effects of other DocumentDeltas. More...

#include <StackableDelta.h>

Inheritance diagram for Document::StackableDelta:

Document::DocumentDelta Document::ChangeVertexSegmentDelta Document::ClearVertexDelta Document::RemoveVertexDelta Document::SetStartPositionsDelta List of all members.

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 > > 
 The DocumentDeltas currently ready to be undone, last first.

Detailed Description

A DocumentDelta that will combine the effects of other DocumentDeltas.

You can stack document deltas up in the apply() function using add_to_stack(delta, track).

Definition at line 28 of file StackableDelta.h.

Constructor & Destructor Documentation

Document::StackableDelta::StackableDelta (  ) 

Definition at line 17 of file StackableDelta.cpp.

Document::StackableDelta::~StackableDelta (  )  [virtual]

Definition at line 21 of file StackableDelta.cpp.

Member Function Documentation

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.

Member Data Documentation

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.

The documentation for this class was generated from the following files:
Get Racer at Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:17 2010 by Doxygen version 1.4.7 for Racer version svn335.