Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
fc::scoped_exit< Callback > Class Template Reference

#include <scoped_exit.hpp>

Public Member Functions

template<typename C >
 scoped_exit (C &&c)
 
 scoped_exit (scoped_exit &&mv)
 
 scoped_exit (const scoped_exit &)=delete
 
scoped_exitoperator= (const scoped_exit &)=delete
 
 ~scoped_exit ()
 
void cancel ()
 

Detailed Description

template<typename Callback>
class fc::scoped_exit< Callback >

Definition at line 8 of file scoped_exit.hpp.

Constructor & Destructor Documentation

◆ scoped_exit() [1/3]

template<typename Callback >
template<typename C >
fc::scoped_exit< Callback >::scoped_exit ( C && c)
inline

Definition at line 11 of file scoped_exit.hpp.

11:callback( std::forward<C>(c) ){}

◆ scoped_exit() [2/3]

template<typename Callback >
fc::scoped_exit< Callback >::scoped_exit ( scoped_exit< Callback > && mv)
inline

Definition at line 13 of file scoped_exit.hpp.

14 :callback( std::move( mv.callback ) ),canceled(mv.canceled)
15 {
16 mv.canceled = true;
17 }

◆ scoped_exit() [3/3]

template<typename Callback >
fc::scoped_exit< Callback >::scoped_exit ( const scoped_exit< Callback > & )
delete

◆ ~scoped_exit()

template<typename Callback >
fc::scoped_exit< Callback >::~scoped_exit ( )
inline

Definition at line 22 of file scoped_exit.hpp.

22 {
23 if (!canceled)
24 try { callback(); } catch( ... ) {}
25 }

Member Function Documentation

◆ cancel()

template<typename Callback >
void fc::scoped_exit< Callback >::cancel ( )
inline

Definition at line 27 of file scoped_exit.hpp.

27{ canceled = true; }

◆ operator=()

template<typename Callback >
scoped_exit & fc::scoped_exit< Callback >::operator= ( const scoped_exit< Callback > & )
delete

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