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

An undo step which does nothing. More...

#include <undo.h>

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

Public Member Functions

 NoOpUndoStep (Map *map, bool valid)
 Constructs an undo step for the given map, and determines its validness. More...
 
 ~NoOpUndoStep () override
 Destructor. More...
 
bool isValid () const override
 Returns the validness as given to the constructor. More...
 
UndoStepundo () override
 Returns a valid NoOpUndoStep. 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...
 
virtual bool getModifiedParts (PartSet &out) const
 Adds the list of the step's modified parts to the container provided by out. More...
 
virtual void getModifiedObjects (int part_index, ObjectSet &out) const
 Adds the list of the step's modified objects to the container provided by out. More...
 
void save (QXmlStreamWriter &xml) const
 Saves the undo step to the stream in xml format. 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 Member Functions inherited from OpenOrienteering::UndoStep
virtual void saveImpl (QXmlStreamWriter &xml) const
 Saves undo properties to the the xml stream. More...
 
virtual void loadImpl (QXmlStreamReader &xml, SymbolDictionary &symbol_dict)
 Loads undo properties from the the xml stream. 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 does nothing.

Its validness depends on the argument given to the constructor. It always returns a valid NoOpUndoStep from undo().

This class is used to catch unknown types of undo step when loading files from newer version of Mapper. Another use is unit-testing the UndoManager.

Constructor & Destructor Documentation

◆ NoOpUndoStep()

OpenOrienteering::NoOpUndoStep::NoOpUndoStep ( Map map,
bool  valid 
)

Constructs an undo step for the given map, and determines its validness.

◆ ~NoOpUndoStep()

OpenOrienteering::NoOpUndoStep::~NoOpUndoStep ( )
override

Destructor.

Member Function Documentation

◆ isValid()

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

Returns the validness as given to the constructor.

Reimplemented from OpenOrienteering::UndoStep.

◆ undo()

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

Returns a valid NoOpUndoStep.

Prints a warning if this undo step is not valid.

Implements OpenOrienteering::UndoStep.


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