SUNphi  1.0
SUNphi::ScopeDoer< FEnd > Class Template Reference

#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.
 

Detailed Description

template<typename FEnd>
class SUNphi::ScopeDoer< FEnd >

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.


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