Mapper  0.9.0
API documentation
Public Member Functions | Protected Member Functions | List of all members
OpenOrienteering::CombinedUndoStep Class Reference

An undo step which is actually a sequence of sub UndoSteps. More...

#include <undo.h>

Inheritance diagram for OpenOrienteering::CombinedUndoStep:
Inheritance graph
[legend]
Collaboration diagram for OpenOrienteering::CombinedUndoStep:
Collaboration graph
[legend]

Public Member Functions

 CombinedUndoStep (Map *map)
 Constructs a composite undo step for the given map. More...
 
 ~CombinedUndoStep () override
 Destructor. More...
 
bool isValid () const override
 Returns true if all sub step can still be undone. More...
 
UndoStepundo () override
 Undoes all sub steps in-order and returns a corresponding UndoStep. More...
 
bool getModifiedParts (PartSet &out) const override
 Adds the modified parts of all sub steps to the given set. More...
 
void getModifiedObjects (int part_index, ObjectSet &out) const override
 Adds the modified objects of all sub steps to the given set. More...
 
int getNumSubSteps () const
 Returns the number of sub steps. More...
 
void push (UndoStep *step)
 Adds a sub step. More...
 
UndoStepgetSubStep (int i)
 Returns the i-th sub step. More...
 
- Public Member Functions inherited from OpenOrienteering::UndoStep
 UndoStep (Type type, Map *map)
 Constructs an undo step having the given type. More...
 
 UndoStep (const UndoStep &)=delete
 
 UndoStep (UndoStep &&)=delete
 
virtual ~UndoStep ()
 Destructor. More...
 
UndoStepoperator= (const UndoStep &)=delete
 
UndoStepoperator= (UndoStep &&)=delete
 
Type getType () const
 Returns the type of the undo step. More...
 
void save (QXmlStreamWriter &xml) const
 Saves the undo step to the stream in xml format. More...
 

Protected Member Functions

void saveImpl (QXmlStreamWriter &xml) const override
 Saves undo properties to the the xml stream. More...
 
void loadImpl (QXmlStreamReader &xml, SymbolDictionary &symbol_dict) override
 Loads undo properties from the the xml stream. More...
 

Additional Inherited Members

- Public Types inherited from OpenOrienteering::UndoStep
enum  Type {
  ReplaceObjectsUndoStepType = 0, DeleteObjectsUndoStepType = 1, AddObjectsUndoStepType = 2, SwitchSymbolUndoStepType = 3,
  SwitchDashesUndoStepType = 4, CombinedUndoStepType = 5, ValidNoOpUndoStepType = 6, ObjectTagsUndoStepType = 7,
  MapPartUndoStepType = 8, SwitchPartUndoStepTypeV0 = 9, SwitchPartUndoStepType = 10, InvalidUndoStepType = 999
}
 Types of undo steps for identification. More...
 
typedef std::set< int > PartSet
 A set of integers referring to parts. More...
 
typedef std::set< Object * > ObjectSet
 A set of pointers to objects. More...
 
- Static Public Member Functions inherited from OpenOrienteering::UndoStep
static UndoStepgetUndoStepForType (Type type, Map *map)
 Constructs an undo step of the given type. More...
 
static UndoStepload (QXmlStreamReader &xml, Map *map, SymbolDictionary &symbol_dict)
 Loads the undo step from the stream in xml format. More...
 
- Protected Attributes inherited from OpenOrienteering::UndoStep
Type const type
 The type of the undo step. More...
 
Map *const map
 The map this undo step belongs. More...
 

Detailed Description

An undo step which is actually a sequence of sub UndoSteps.

A CombinedUndoStep bundles a sequence of one or more UndoSteps, which it executes in reverse order.

Constructor & Destructor Documentation

◆ CombinedUndoStep()

OpenOrienteering::CombinedUndoStep::CombinedUndoStep ( Map map)

Constructs a composite undo step for the given map.

◆ ~CombinedUndoStep()

OpenOrienteering::CombinedUndoStep::~CombinedUndoStep ( )
override

Destructor.

Member Function Documentation

◆ getModifiedObjects()

void OpenOrienteering::CombinedUndoStep::getModifiedObjects ( int  part_index,
ObjectSet out 
) const
overridevirtual

Adds the modified objects of all sub steps to the given set.

Reimplemented from OpenOrienteering::UndoStep.

◆ getModifiedParts()

bool OpenOrienteering::CombinedUndoStep::getModifiedParts ( PartSet out) const
overridevirtual

Adds the modified parts of all sub steps to the given set.

Reimplemented from OpenOrienteering::UndoStep.

◆ getNumSubSteps()

int OpenOrienteering::CombinedUndoStep::getNumSubSteps ( ) const
inline

Returns the number of sub steps.

◆ getSubStep()

UndoStep * OpenOrienteering::CombinedUndoStep::getSubStep ( int  i)
inline

Returns the i-th sub step.

◆ isValid()

bool OpenOrienteering::CombinedUndoStep::isValid ( ) const
overridevirtual

Returns true if all sub step can still be undone.

Reimplemented from OpenOrienteering::UndoStep.

◆ loadImpl()

void OpenOrienteering::CombinedUndoStep::loadImpl ( QXmlStreamReader xml,
SymbolDictionary symbol_dict 
)
overrideprotectedvirtual

Loads undo properties from the the xml stream.

Reimplemented from OpenOrienteering::UndoStep.

◆ push()

void OpenOrienteering::CombinedUndoStep::push ( UndoStep step)
inline

Adds a sub step.

◆ saveImpl()

void OpenOrienteering::CombinedUndoStep::saveImpl ( QXmlStreamWriter xml) const
overrideprotectedvirtual

Saves undo properties to the the xml stream.

Reimplemented from OpenOrienteering::UndoStep.

◆ undo()

UndoStep * OpenOrienteering::CombinedUndoStep::undo ( )
overridevirtual

Undoes all sub steps in-order and returns a corresponding UndoStep.

Implements OpenOrienteering::UndoStep.


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