![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qsql_firebird_helpers_p.h>
Public Types | |
| using | FreeFn = void (*)(T *) |
Public Member Functions | |
| Q_NODISCARD_CTOR | FbGuard (T *handle, FreeFn freeFn) |
| ~FbGuard () | |
| FbGuard (const FbGuard &)=delete | |
| FbGuard & | operator= (const FbGuard &)=delete |
| T * | get () const |
| T * | operator-> () const |
| operator bool () const | |
| T * | take () |
| void | dismiss () |
| template<typename CloseFn> | |
| void | closeWith (CloseFn closeFn, bool rethrow=true) |
Definition at line 58 of file qsql_firebird_helpers_p.h.
Definition at line 61 of file qsql_firebird_helpers_p.h.
|
inline |
A discarded unnamed temporary would free the handle immediately while later code keeps using it — force the guard to be a named local.
Definition at line 66 of file qsql_firebird_helpers_p.h.
Definition at line 67 of file qsql_firebird_helpers_p.h.
Intentionally scope-pinned: not copyable, and no move operations — ownership transfer goes through take() instead.
|
inline |
Graceful close. On success the guard is dismissed (close already released the interface). If closeFn throws, the destructor still frees the handle; the exception is rethrown unless rethrow == false (for noexcept cleanup paths that must not propagate).
Definition at line 90 of file qsql_firebird_helpers_p.h.
Definition at line 81 of file qsql_firebird_helpers_p.h.
|
inline |
Definition at line 75 of file qsql_firebird_helpers_p.h.
|
inlineexplicit |
Definition at line 77 of file qsql_firebird_helpers_p.h.
|
inline |
Definition at line 76 of file qsql_firebird_helpers_p.h.
|
inline |
Definition at line 80 of file qsql_firebird_helpers_p.h.