|
cesium-native 0.52.0
|
A utility that will automatically call the lambda function when exiting a scope. More...
#include <CesiumUtility/ScopeGuard.h>
Public Member Functions | |
| template<typename ExitFunctionArg, typename std::enable_if_t< !std::is_same_v< std::remove_reference_t< std::remove_const_t< ExitFunctionArg > >, ScopeGuard< ExitFunction > >, int > = 0> | |
| ScopeGuard (ExitFunctionArg &&exitFunc) | |
| Constructor. | |
| ScopeGuard (const ScopeGuard &rhs)=delete | |
| ScopeGuard (ScopeGuard &&rhs) noexcept | |
| Move constructor. The rhs will move its lambda to the lhs, and the rhs will not call its lambda upon exiting a scope. | |
| ScopeGuard & | operator= (const ScopeGuard &rhs)=delete |
| ScopeGuard & | operator= (ScopeGuard &&rhs) noexcept |
| Move assignment operator. The rhs will move its lambda to the lhs, and the rhs will not call its lambda upon exiting a scope. | |
| ~ScopeGuard () noexcept | |
| Destructor. The guard will execute the lambda function when exiting a scope if it's not released. | |
| void | release () noexcept |
| Upon calling ScopeGuard::release(), the guard will not execute the lambda function when exiting a scope. | |
A utility that will automatically call the lambda function when exiting a scope.
| ExitFunction | The function type to be called when the guard is out of scope. |
Definition at line 14 of file ScopeGuard.h.
|
inlineexplicit |
Constructor.
| exitFunc | The function type to be called when the guard is out of scope |
Definition at line 29 of file ScopeGuard.h.
|
inlinenoexcept |
Move constructor. The rhs will move its lambda to the lhs, and the rhs will not call its lambda upon exiting a scope.
Definition at line 39 of file ScopeGuard.h.
|
inlinenoexcept |
Destructor. The guard will execute the lambda function when exiting a scope if it's not released.
Definition at line 65 of file ScopeGuard.h.
|
inlinenoexcept |
Move assignment operator. The rhs will move its lambda to the lhs, and the rhs will not call its lambda upon exiting a scope.
Definition at line 51 of file ScopeGuard.h.
|
inlinenoexcept |
Upon calling ScopeGuard::release(), the guard will not execute the lambda function when exiting a scope.
Definition at line 75 of file ScopeGuard.h.