Inviwo  0.9.10.1
Inviwo documentation
inviwo::util::OnScopeExit Class Reference

calls the given function when leaving the current scope More...

#include <raiiutils.h>

Public Types

typedef std::function< void(void)> ExitAction
 

Public Member Functions

 OnScopeExit (OnScopeExit const &)=delete
 
OnScopeExitoperator= (OnScopeExit const &that)=delete
 
 OnScopeExit (OnScopeExit &&rhs)
 
OnScopeExitoperator= (OnScopeExit &&that)
 
 OnScopeExit (ExitAction action)
 
void setAction (ExitAction action=nullptr)
 
void release ()
 

Detailed Description

calls the given function when leaving the current scope

An instance of this class will call the provided action, i.e. a void function, when leaving the current scope. The action will also be called in case the constructor fails.

The action can be changed at any time by calling setAction() or release().


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