OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
WActionHandler Class Reference

Handles undo and redo action. More...

#include <WActionHandler.h>

+ Collaboration diagram for WActionHandler:

Public Types

typedef std::shared_ptr< WActionHandlerSPtr
 A shared_ptr to this class. More...
 

Public Member Functions

 WActionHandler ()
 Creates the undo and redo vectors. More...
 
 ~WActionHandler ()
 Clears the vectors for destruction. More...
 
void pushAction (WFiberAction::SPtr action)
 Pushes an action to the undo vector and clears the redo vector. More...
 
void undo ()
 Undos the last action and pushes it to the redo vector. More...
 
void redo ()
 Redos the last action and pushes it to the undo vector. More...
 

Private Types

typedef std::shared_ptr< std::vector< WFiberAction::SPtr > > ActionStack
 A shared_ptr to a vector of an action. More...
 

Private Attributes

ActionStack m_undo
 The undo vector. More...
 
ActionStack m_redo
 The redo vector. More...
 

Detailed Description

Handles undo and redo action.

Definition at line 37 of file WActionHandler.h.

Member Typedef Documentation

◆ ActionStack

typedef std::shared_ptr< std::vector< WFiberAction::SPtr > > WActionHandler::ActionStack
private

A shared_ptr to a vector of an action.

Definition at line 75 of file WActionHandler.h.

◆ SPtr

typedef std::shared_ptr< WActionHandler > WActionHandler::SPtr

A shared_ptr to this class.

Definition at line 43 of file WActionHandler.h.

Constructor & Destructor Documentation

◆ WActionHandler()

WActionHandler::WActionHandler ( )

Creates the undo and redo vectors.

Definition at line 30 of file WActionHandler.cpp.

References m_redo, and m_undo.

◆ ~WActionHandler()

WActionHandler::~WActionHandler ( )

Clears the vectors for destruction.

Definition at line 36 of file WActionHandler.cpp.

References m_redo, and m_undo.

Member Function Documentation

◆ pushAction()

void WActionHandler::pushAction ( WFiberAction::SPtr  action)

Pushes an action to the undo vector and clears the redo vector.

Parameters
actionThe ation to push.

Definition at line 42 of file WActionHandler.cpp.

References m_redo, and m_undo.

◆ redo()

void WActionHandler::redo ( )

Redos the last action and pushes it to the undo vector.

Definition at line 63 of file WActionHandler.cpp.

References m_redo, and m_undo.

Referenced by WKeyboardHandler::handle().

+ Here is the caller graph for this function:

◆ undo()

void WActionHandler::undo ( )

Undos the last action and pushes it to the redo vector.

Definition at line 48 of file WActionHandler.cpp.

References m_redo, and m_undo.

Referenced by WKeyboardHandler::handle().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_redo

ActionStack WActionHandler::m_redo
private

The redo vector.

Definition at line 85 of file WActionHandler.h.

Referenced by pushAction(), redo(), undo(), WActionHandler(), and ~WActionHandler().

◆ m_undo

ActionStack WActionHandler::m_undo
private

The undo vector.

Definition at line 80 of file WActionHandler.h.

Referenced by pushAction(), redo(), undo(), WActionHandler(), and ~WActionHandler().


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