HDK
|
Go to the source code of this file.
Classes | |
class | UT_ScopeExit< F > |
UT_ScopeExit which runs the given lambda on destruction. More... | |
Namespaces | |
UT_ScopeGuard | |
Macros | |
#define | UT_SCOPE_EXIT_CONCAT_IMPL(x, y) x ## y |
#define | UT_SCOPE_EXIT_CONCAT(x, y) UT_SCOPE_EXIT_CONCAT_IMPL(x, y) |
#define | UT_SCOPE_EXIT_VAR(name) UT_SCOPE_EXIT_CONCAT(name, __COUNTER__) |
#define | UT_SCOPE_EXIT_RUN_IMPL(func_name, scope_name,...) |
#define | UT_AT_SCOPE_EXIT(...) |
#define | UT_SCOPE_EXIT |
Enumerations | |
enum | UT_ScopeGuard::OnExit |
Functions | |
template<typename F > | |
UT_ScopeExit< F > | UT_ScopeGuard::operator+ (OnExit, F &&fn) |
UT_SCOPE_EXIT/UT_AT_SCOPE_EXIT provides convenient mechanisms to do RAII without writing a special struct does cleans up upon destruction. The code within the scope exit block is executed in reverse order of declaration as the innermost enclosing scope ends. If execution never passes through a scope exit block in the first place, then it won't be executed.
Definition in file UT_ScopeExit.h.
#define UT_AT_SCOPE_EXIT | ( | ... | ) |
Runs given statement within the parentheses when the scope exits.
Definition at line 95 of file UT_ScopeExit.h.
#define UT_SCOPE_EXIT |
Runs given statement block after it when the current scope exits.
Definition at line 112 of file UT_ScopeExit.h.
#define UT_SCOPE_EXIT_CONCAT | ( | x, | |
y | |||
) | UT_SCOPE_EXIT_CONCAT_IMPL(x, y) |
Definition at line 73 of file UT_ScopeExit.h.
#define UT_SCOPE_EXIT_RUN_IMPL | ( | func_name, | |
scope_name, | |||
... | |||
) |
Definition at line 79 of file UT_ScopeExit.h.
#define UT_SCOPE_EXIT_VAR | ( | name | ) | UT_SCOPE_EXIT_CONCAT(name, __COUNTER__) |
Definition at line 74 of file UT_ScopeExit.h.