Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkScopeExit Class Reference

#include <SkScopeExit.h>

Public Member Functions

 SkScopeExit ()=default
 
 SkScopeExit (std::function< void()> f)
 
 SkScopeExit (SkScopeExit &&that)
 
 ~SkScopeExit ()
 
void clear ()
 
SkScopeExitoperator= (SkScopeExit &&that)
 

Detailed Description

SkScopeExit calls a std:function<void()> in its destructor.

Definition at line 17 of file SkScopeExit.h.

Constructor & Destructor Documentation

◆ SkScopeExit() [1/3]

SkScopeExit::SkScopeExit ( )
default

◆ SkScopeExit() [2/3]

SkScopeExit::SkScopeExit ( std::function< void()>  f)
inline

Definition at line 20 of file SkScopeExit.h.

20: fFn(std::move(f)) {}

◆ SkScopeExit() [3/3]

SkScopeExit::SkScopeExit ( SkScopeExit &&  that)
inline

Definition at line 21 of file SkScopeExit.h.

21: fFn(std::move(that.fFn)) {}

◆ ~SkScopeExit()

SkScopeExit::~SkScopeExit ( )
inline

Definition at line 23 of file SkScopeExit.h.

23 {
24 if (fFn) {
25 fFn();
26 }
27 }

Member Function Documentation

◆ clear()

void SkScopeExit::clear ( )
inline

Definition at line 29 of file SkScopeExit.h.

29{ fFn = {}; }

◆ operator=()

SkScopeExit & SkScopeExit::operator= ( SkScopeExit &&  that)
inline

Definition at line 31 of file SkScopeExit.h.

31 {
32 fFn = std::move(that.fFn);
33 return *this;
34 }

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