Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::Operation Class Reference

Base class for all operations in the undo/redo framework. More...

#include <mitkOperation.h>

Inheritance diagram for mitk::Operation:

Public Member Functions

 mitkClassMacroNoParent (Operation) virtual bool IsValid() const
 Check whether this operation is still valid and can be executed. More...
 
virtual ~Operation ()=default
 Virtual destructor. More...
 
OperationType GetOperationType ()
 Get the type identifier of this operation. More...
 

Protected Member Functions

 Operation (OperationType operationType)
 Construct an operation with the given type. More...
 
 Operation (const Operation &)=default
 
 Operation (Operation &&)=default
 
Operation & operator= (const Operation &)=default
 
Operation & operator= (Operation &&)=default
 

Protected Attributes

OperationType m_OperationType
 The type identifier for this operation. More...
 

Detailed Description

Base class for all operations in the undo/redo framework.

An Operation encapsulates a single undoable/redoable action. Each concrete operation subclass stores the data needed to perform and reverse the action. Operations are paired in OperationEvent objects (do-operation and undo-operation).

See also
OperationEvent, UndoController, OperationActor

Definition at line 37 of file mitkOperation.h.

Constructor & Destructor Documentation

◆ ~Operation()

virtual mitk::Operation::~Operation ( )
virtualdefault

Virtual destructor.

◆ Operation() [1/3]

mitk::Operation::Operation ( OperationType  operationType)
protected

Construct an operation with the given type.

Parameters
[in]operationTypeThe operation type identifier.

◆ Operation() [2/3]

mitk::Operation::Operation ( const Operation &  )
protecteddefault

◆ Operation() [3/3]

mitk::Operation::Operation ( Operation &&  )
protecteddefault

Member Function Documentation

◆ GetOperationType()

OperationType mitk::Operation::GetOperationType ( )

Get the type identifier of this operation.

Returns
The operation type (values defined in mitkInteractionConst.h).

◆ mitkClassMacroNoParent()

mitk::Operation::mitkClassMacroNoParent ( Operation  ) const

Check whether this operation is still valid and can be executed.

The default implementation always returns true. Subclasses may override to reflect invalidation (e.g. when the target object has been deleted).

Returns
True if the operation can be executed.

◆ operator=() [1/2]

Operation& mitk::Operation::operator= ( const Operation &  )
protecteddefault

◆ operator=() [2/2]

Operation& mitk::Operation::operator= ( Operation &&  )
protecteddefault

Member Data Documentation

◆ m_OperationType

OperationType mitk::Operation::m_OperationType
protected

The type identifier for this operation.

Definition at line 72 of file mitkOperation.h.


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