SUNphi
1.0
|
#include <ScopeDoer.hpp>
Public Member Functions | |
bool | willUndo () const |
Check if will undo. | |
ScopeDoer (ScopeDoer &&oth) | |
Move constructor. | |
template<typename FBegin > | |
ScopeDoer (FBegin fBegin, FEnd fEnd) | |
Create, do and set what to do at destruction. | |
ScopeDoer (FEnd fEnd) | |
Create, set what to do at destruction. | |
~ScopeDoer () | |
Destroy undoing. | |
Private Member Functions | |
ScopeDoer (const ScopeDoer &)=delete | |
Forbids copy constructor. | |
Private Attributes | |
FEnd | fEnd |
Function to be called at destroy. | |
bool | undoAtEnd |
Store whether we need to undo at the end. | |
Class which does something when created and something else when destroyed
The action performed at the beginning must return whether the action had an effect or not, such that the undo is issued or not at the destruction. The action performed at the end needs not to return anything (can return whatever).
Definition at line 19 of file ScopeDoer.hpp.