wxScopeGuard Class Reference | wxWidgets

| Version: 3.2.11

Loading...
Searching...
No Matches
Public Member Functions | List of all members
wxScopeGuard Class Reference
Class List by Category » Miscellaneous

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.2/wxWidgets3.2-3.2.11-1.x86_64/src/wxWidgets-3.2.11/interface/wx/scopeguard.h>`

## Detailed Description

Scope guard is an object which allows executing an action on scope exit.

The objects of this class must be constructed using wxMakeGuard() function.

##

Library: None; this class implementation is entirely header-based.
Category: Miscellaneous

## Public Member Functions
void | Dismiss ()
| Call this method to dismiss the execution of the action on scope exit.

## Member Function Documentation

## ◆ Dismiss()

void wxScopeGuard::Dismiss | ( |  | ) |

Call this method to dismiss the execution of the action on scope exit.

A typical example:

Update1();
// ensure that changes done so far are rolled back if the next
// operation throws
wxScopeGuard guard = wxMakeGuard(RollBack);
Update2();
// it didn't throw so commit the changes, i.e. avoid rolling back
guard.Dismiss();
wxScopeGuard
Scope guard is an object which allows executing an action on scope exit.
Definition scopeguard.h:19
wxScopeGuard::Dismiss
void Dismiss()
Call this method to dismiss the execution of the action on scope exit.
wxMakeGuard
wxScopeGuard wxMakeGuard(F func, P1 p1,..., PN pN)
Returns a scope guard object which will call the specified function with the given parameters on scop...