Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::ScopeGuard Class Reference

#include <src/libslic3r/Utils.hpp>

Public Types

typedef std::function< void()> Closure
 

Public Member Functions

 ScopeGuard ()
 
 ScopeGuard (Closure closure)
 
 ScopeGuard (const ScopeGuard &)=delete
 
 ScopeGuard (ScopeGuard &&other)
 
 ~ScopeGuard ()
 
ScopeGuardoperator= (const ScopeGuard &)=delete
 
ScopeGuardoperator= (ScopeGuard &&other)
 
void reset ()
 

Public Attributes

Closure closure
 

Detailed Description

Member Typedef Documentation

◆ Closure

typedef std::function<void()> Slic3r::ScopeGuard::Closure

Constructor & Destructor Documentation

◆ ScopeGuard() [1/4]

Slic3r::ScopeGuard::ScopeGuard ( )
inline
288{}

◆ ScopeGuard() [2/4]

Slic3r::ScopeGuard::ScopeGuard ( Closure  closure)
inline
289: closure(std::move(closure)) {}
Closure closure
Definition Utils.hpp:285

◆ ScopeGuard() [3/4]

Slic3r::ScopeGuard::ScopeGuard ( const ScopeGuard )
delete

◆ ScopeGuard() [4/4]

Slic3r::ScopeGuard::ScopeGuard ( ScopeGuard &&  other)
inline
291: closure(std::move(other.closure)) {}

◆ ~ScopeGuard()

Slic3r::ScopeGuard::~ScopeGuard ( )
inline
294 {
295 if (closure) { closure(); }
296 }

References closure.

Member Function Documentation

◆ operator=() [1/2]

ScopeGuard & Slic3r::ScopeGuard::operator= ( const ScopeGuard )
delete

◆ operator=() [2/2]

ScopeGuard & Slic3r::ScopeGuard::operator= ( ScopeGuard &&  other)
inline
300 {
301 closure = std::move(other.closure);
302 return *this;
303 }

References closure.

◆ reset()

void Slic3r::ScopeGuard::reset ( )
inline
305{ closure = Closure(); }
std::function< void()> Closure
Definition Utils.hpp:284

References closure.

Member Data Documentation

◆ closure

Closure Slic3r::ScopeGuard::closure

Referenced by ~ScopeGuard(), operator=(), and reset().


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