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]

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 54 of file scopeguard.hxx.

Constructor & Destructor Documentation

◆ ScopeGuard() [1/2]

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

Definition at line 59 of file scopeguard.hxx.

◆ ~ScopeGuard()

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

◆ ScopeGuard() [2/2]

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

Member Function Documentation

◆ dismiss()

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

Dismisses the scope guard, i.e.

the function won't be executed.

Definition at line 71 of file scopeguard.hxx.

References comphelper::ScopeGuard< Func >::m_bDismissed.

◆ operator=()

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

Member Data Documentation

◆ m_bDismissed

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

◆ m_func

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

Definition at line 78 of file scopeguard.hxx.

Referenced by comphelper::ScopeGuard< Func >::~ScopeGuard().


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