![]() |
OpenWalnut
1.5.0dev
|
Handles undo and redo action. More...
#include <WActionHandler.h>
Collaboration diagram for WActionHandler:Public Types | |
| typedef std::shared_ptr< WActionHandler > | SPtr |
| 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... | |
Handles undo and redo action.
Definition at line 37 of file WActionHandler.h.
|
private |
A shared_ptr to a vector of an action.
Definition at line 75 of file WActionHandler.h.
| typedef std::shared_ptr< WActionHandler > WActionHandler::SPtr |
A shared_ptr to this class.
Definition at line 43 of file WActionHandler.h.
| WActionHandler::WActionHandler | ( | ) |
Creates the undo and redo vectors.
Definition at line 30 of file WActionHandler.cpp.
| WActionHandler::~WActionHandler | ( | ) |
Clears the vectors for destruction.
Definition at line 36 of file WActionHandler.cpp.
| void WActionHandler::pushAction | ( | WFiberAction::SPtr | action | ) |
Pushes an action to the undo vector and clears the redo vector.
| action | The ation to push. |
Definition at line 42 of file WActionHandler.cpp.
| 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:| 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:
|
private |
The redo vector.
Definition at line 85 of file WActionHandler.h.
Referenced by pushAction(), redo(), undo(), WActionHandler(), and ~WActionHandler().
|
private |
The undo vector.
Definition at line 80 of file WActionHandler.h.
Referenced by pushAction(), redo(), undo(), WActionHandler(), and ~WActionHandler().