OpenShot Audio Library | OpenShotAudio 0.4.0
|
#include <juce_ScopeGuard.h>
Public Member Functions | |
ErasedScopeGuard ()=default | |
ErasedScopeGuard (std::function< void()> d) | |
ErasedScopeGuard (ErasedScopeGuard &&other) noexcept | |
ErasedScopeGuard & | operator= (ErasedScopeGuard &&other) noexcept |
~ErasedScopeGuard () noexcept | |
void | reset () |
void | release () |
A ScopeGuard that uses a std::function internally to allow type erasure. This can be handy; it allows lots of ErasedScopeGuards, all with different callbacks, to be stored in a homogeneous container.
An instance of this type will automatically call its callback when it is destroyed.
ErasedScopeGuard has a few similarities with std::unique_ptr:
Definition at line 76 of file juce_ScopeGuard.h.
|
default |
Constructs an ErasedScopeGuard with no callback.
|
explicit |
Constructs an ErasedScopeGuard that will call the provided callback when the Guard is destroyed.
Definition at line 26 of file juce_ScopeGuard.cpp.
|
noexcept |
Constructs an instance that assumes responsibility for calling other's callback.
Definition at line 29 of file juce_ScopeGuard.cpp.
|
noexcept |
Destructor, calls the callback assigned to this ScopeGuard.
Definition at line 39 of file juce_ScopeGuard.cpp.
|
noexcept |
Calls the stored callback, if any, then assumes responsibility for calling other's callback. After this call, other will be reset to its default state.
Definition at line 32 of file juce_ScopeGuard.cpp.
void juce::ErasedScopeGuard::release | ( | ) |
Resets this instance to its default state without calling the stored callback.
Definition at line 50 of file juce_ScopeGuard.cpp.
void juce::ErasedScopeGuard::reset | ( | ) |
Calls the stored callback, if any, then resets this instance to its default state.
Definition at line 44 of file juce_ScopeGuard.cpp.
Referenced by ~ErasedScopeGuard().