OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::ScopeGuard Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/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 ()
ScopeGuard & operator= (const ScopeGuard &)=delete
ScopeGuard & operator= (ScopeGuard &&other)
void reset ()

Private 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
541{}

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

Here is the caller graph for this function:

◆ ScopeGuard() [2/4]

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

References closure.

◆ ScopeGuard() [3/4]

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

References ScopeGuard().

Here is the call graph for this function:

◆ ScopeGuard() [4/4]

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

References ScopeGuard(), and closure.

Here is the call graph for this function:

◆ ~ScopeGuard()

Slic3r::ScopeGuard::~ScopeGuard ( )
inline
547 {
548 if (closure) { closure(); }
549 }

References closure.

Member Function Documentation

◆ operator=() [1/2]

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

References ScopeGuard().

Here is the call graph for this function:

◆ operator=() [2/2]

ScopeGuard & Slic3r::ScopeGuard::operator= ( ScopeGuard && other)
inline
553 {
554 closure = std::move(other.closure);
555 return *this;
556 }

References ScopeGuard(), and closure.

Here is the call graph for this function:

◆ reset()

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

References closure.

Member Data Documentation

◆ closure

Closure Slic3r::ScopeGuard::closure
private

The documentation for this class was generated from the following file:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Utils.hpp