Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::util::OnScopeExit Struct Reference

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

#include <inviwo/core/util/raiiutils.h>

Public Types

using ExitAction = std::function<void(void)>
 

Public Member Functions

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

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 struct was generated from the following file: