The OngoingCommandDispatcher class. More...
Detailed Description
The OngoingCommandDispatcher class.
A basic, type-unsafe dispatcher for a commands that have continuous edition capabilities.
That is, it is useful when you want to have a command that has a long initialization but a very fast update. For instance, moving an object : initializing the command is (relatively) long so we don't want to create a new one at every mouse movement.
Instead, such commands have an update() function with the same arguments than the used constructor.
This dispatcher will call the correct method of the given command whether we're initializing it for the first time, or modifying the existing command.
Public Member Functions | |
| OngoingCommandDispatcher (const score::CommandStackFacade &stack) | |
| void | watch (const QObject *obj) |
| void | unwatch (const QObject *obj) |
| bool | watching (const QObject *obj) const noexcept |
| template<typename TheCommand , typename Watched , typename... Args> | |
| void | submit (Watched &&watched, Args &&... args) |
| void | commit () |
| void | rollback () |
| If the command has to be reverted, for instance when pressing escape. | |
| void | rollback_without_undo () |
Public Member Functions inherited from ICommandDispatcher | |
| ICommandDispatcher (const score::CommandStack &stack)=delete | |
| ICommandDispatcher (const score::CommandStackFacade &stack) | |
| const score::CommandStackFacade & | stack () const |
Member Function Documentation
◆ commit()
| void OngoingCommandDispatcher::commit | ( | ) |
When the command is finished and can be sent to the undo - redo stack. For instance on mouse release.
◆ submit()
|
inline |
Call this repeatedly to make the command, for instance on click and when the mouse moves.
◆ watching()
|
inlinenoexcept |
Whether obj is the object of the current – or, if none is in progress, the most recent – interaction. Kept past commit() so that re-editing the same object does not have to re-arm its watch.
The documentation for this class was generated from the following files:
- OngoingCommandDispatcher.hpp
- Document.cpp
Public Member Functions inherited from