Audacity 3.2.0
|
A class representing a safe connection to SQLite. More...
#include <SafeConnection.h>
Classes | |
struct | Lock |
struct | Tag |
Public Member Functions | |
SafeConnection (Tag, Connection connection) | |
Lock | Acquire () noexcept |
Static Public Member Functions | |
static std::shared_ptr< SafeConnection > | Open (std::string_view path, OpenMode mode=OpenMode::ReadWriteCreate, ThreadMode threadMode=ThreadMode::Serialized, Error *openError=nullptr) |
static std::shared_ptr< SafeConnection > | Reopen (const Connection &connection, OpenMode mode=OpenMode::ReadWriteCreate, ThreadMode threadMode=ThreadMode::Serialized, Error *openError=nullptr) |
static std::shared_ptr< SafeConnection > | Reopen (sqlite3 *connection, OpenMode mode=OpenMode::ReadWriteCreate, ThreadMode threadMode=ThreadMode::Serialized, Error *openError=nullptr) |
static std::shared_ptr< SafeConnection > | Reopen (SafeConnection &connection, OpenMode mode=OpenMode::ReadWriteCreate, ThreadMode threadMode=ThreadMode::Serialized, Error *openError=nullptr) |
Private Types | |
using | MutexType = std::recursive_mutex |
Private Attributes | |
Connection | mConnection |
MutexType | mConnectionMutex |
A class representing a safe connection to SQLite.
This class is a wrapper around the Connection class that provides a thread-safe access to the connection.
Definition at line 21 of file SafeConnection.h.
|
private |
Definition at line 28 of file SafeConnection.h.
audacity::sqlite::SafeConnection::SafeConnection | ( | Tag | , |
Connection | connection | ||
) |
Definition at line 11 of file SafeConnection.cpp.
|
noexcept |
Definition at line 85 of file SafeConnection.cpp.
|
static |
Definition at line 16 of file SafeConnection.cpp.
References audacity::sqlite::Connection::Open().
Referenced by audacity::cloud::audiocom::sync::CloudProjectsDatabase::OpenConnection().
|
static |
Definition at line 33 of file SafeConnection.cpp.
References audacity::sqlite::Connection::Reopen().
|
static |
Definition at line 67 of file SafeConnection.cpp.
References mConnection, and audacity::sqlite::Connection::Reopen().
|
static |
Definition at line 50 of file SafeConnection.cpp.
References audacity::sqlite::Connection::Reopen().
|
private |
Definition at line 80 of file SafeConnection.h.
Referenced by Reopen().
|
private |
Definition at line 81 of file SafeConnection.h.