JAPAn
Just Another Parity Analyzer
|
A RAII-style scoped database connection. More...
#include <QwDatabase.h>
Public Member Functions | |
QwScopedConnection (QwDatabase *db) | |
~QwScopedConnection () | |
QwScopedConnection (const QwScopedConnection &)=delete | |
QwScopedConnection & | operator= (const QwScopedConnection &)=delete |
QwScopedConnection (QwScopedConnection &&other) noexcept | |
QwScopedConnection & | operator= (QwScopedConnection &&other) noexcept |
QwDatabase * | operator-> () |
const QwDatabase * | operator-> () const |
QwDatabase & | operator* () |
const QwDatabase & | operator* () const |
bool | IsConnected () const |
Private Attributes | |
QwDatabase * | fDatabase |
bool | fConnected |
A RAII-style scoped database connection.
This class provides automatic connection management using RAII principles. The connection is established when the object is created and automatically disconnected when the object goes out of scope.
Definition at line 83 of file QwDatabase.h.
|
explicit |
Definition at line 28 of file QwDatabase.cc.
References QwLog::endl(), fConnected, fDatabase, and QwError.
Referenced by operator=(), operator=(), QwScopedConnection(), and QwScopedConnection().
QwScopedConnection::~QwScopedConnection | ( | ) |
Definition at line 38 of file QwDatabase.cc.
References fConnected, and fDatabase.
|
delete |
|
noexcept |
Definition at line 45 of file QwDatabase.cc.
References fConnected, fDatabase, and QwScopedConnection().
bool QwScopedConnection::IsConnected | ( | ) | const |
Definition at line 69 of file QwDatabase.cc.
References fConnected, and fDatabase.
|
inline |
|
inline |
|
inline |
|
inline |
|
delete |
|
noexcept |
Definition at line 51 of file QwDatabase.cc.
References fConnected, fDatabase, and QwScopedConnection().
|
private |
Definition at line 86 of file QwDatabase.h.
Referenced by IsConnected(), operator=(), QwScopedConnection(), QwScopedConnection(), and ~QwScopedConnection().
|
private |
Definition at line 85 of file QwDatabase.h.
Referenced by IsConnected(), operator*(), operator*(), operator->(), operator->(), operator=(), QwScopedConnection(), QwScopedConnection(), and ~QwScopedConnection().