LibreOffice Module comphelper (master)  1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
comphelper::ScopeGuard< Func > Class Template Reference

ScopeGuard to ease writing exception-safe code. More...

#include <scopeguard.hxx>

Inheritance diagram for comphelper::ScopeGuard< Func >:
[legend]
Collaboration diagram for comphelper::ScopeGuard< Func >:
[legend]

Public Member Functions

 ScopeGuard (Func &&func)
 
 ~ScopeGuard ()
 
void dismiss ()
 Dismisses the scope guard, i.e. More...
 

Private Member Functions

 ScopeGuard (const ScopeGuard &)=delete
 
ScopeGuardoperator= (const ScopeGuard &)=delete
 

Private Attributes

Func m_func
 
bool m_bDismissed = false
 

Detailed Description

template<class Func>
class comphelper::ScopeGuard< Func >

ScopeGuard to ease writing exception-safe code.

Definition at line 52 of file scopeguard.hxx.

Constructor & Destructor Documentation

template<class Func>
comphelper::ScopeGuard< Func >::ScopeGuard ( Func &&  func)
inlineexplicit
Parameters
funcfunction object to be executed in dtor

Definition at line 57 of file scopeguard.hxx.

template<class Func>
comphelper::ScopeGuard< Func >::~ScopeGuard ( )
inline

Definition at line 59 of file scopeguard.hxx.

template<class Func>
comphelper::ScopeGuard< Func >::ScopeGuard ( const ScopeGuard< Func > &  )
privatedelete

Member Function Documentation

template<class Func>
void comphelper::ScopeGuard< Func >::dismiss ( )
inline

Dismisses the scope guard, i.e.

the function won't be executed.

Definition at line 80 of file scopeguard.hxx.

template<class Func>
ScopeGuard& comphelper::ScopeGuard< Func >::operator= ( const ScopeGuard< Func > &  )
privatedelete

Member Data Documentation

template<class Func>
bool comphelper::ScopeGuard< Func >::m_bDismissed = false
private
template<class Func>
Func comphelper::ScopeGuard< Func >::m_func
private

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