Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
audacity::sqlite::SafeConnection::Lock Struct Referencefinal

#include <SafeConnection.h>

Collaboration diagram for audacity::sqlite::SafeConnection::Lock:
[legend]

Public Member Functions

 Lock (std::shared_ptr< SafeConnection > connection)
 
 ~Lock ()=default
 
 Lock (const Lock &)=delete
 
Lockoperator= (const Lock &)=delete
 
 Lock (Lock &&)=default
 
Lockoperator= (Lock &&)=default
 
Connectionoperator-> () noexcept
 
const Connectionoperator-> () const noexcept
 
Connectionoperator* () noexcept
 
const Connectionoperator* () const noexcept
 
 operator bool () const noexcept
 
bool IsValid () const noexcept
 

Private Attributes

std::shared_ptr< SafeConnectionmSafeConnection
 
std::unique_lock< MutexTypemLock
 

Detailed Description

Definition at line 53 of file SafeConnection.h.

Constructor & Destructor Documentation

◆ Lock() [1/3]

audacity::sqlite::SafeConnection::Lock::Lock ( std::shared_ptr< SafeConnection connection)
explicit

Definition at line 90 of file SafeConnection.cpp.

91 : mSafeConnection(std::move(connection))
92{
94 mLock = std::unique_lock { mSafeConnection->mConnectionMutex };
95}
std::shared_ptr< SafeConnection > mSafeConnection
std::unique_lock< MutexType > mLock

References mLock, and mSafeConnection.

◆ ~Lock()

audacity::sqlite::SafeConnection::Lock::~Lock ( )
default

◆ Lock() [2/3]

audacity::sqlite::SafeConnection::Lock::Lock ( const Lock )
delete

◆ Lock() [3/3]

audacity::sqlite::SafeConnection::Lock::Lock ( Lock &&  )
default

Member Function Documentation

◆ IsValid()

bool audacity::sqlite::SafeConnection::Lock::IsValid ( ) const
noexcept

Definition at line 122 of file SafeConnection.cpp.

123{
124 return mSafeConnection != nullptr;
125}

◆ operator bool()

audacity::sqlite::SafeConnection::Lock::operator bool ( ) const
explicitnoexcept

Definition at line 117 of file SafeConnection.cpp.

118{
119 return IsValid();
120}

◆ operator*() [1/2]

const Connection & audacity::sqlite::SafeConnection::Lock::operator* ( ) const
noexcept

Definition at line 112 of file SafeConnection.cpp.

113{
114 return mSafeConnection->mConnection;
115}

References audacity::sqlite::Connection::mConnection.

◆ operator*() [2/2]

Connection & audacity::sqlite::SafeConnection::Lock::operator* ( )
noexcept

Definition at line 107 of file SafeConnection.cpp.

108{
109 return mSafeConnection->mConnection;
110}

References audacity::sqlite::Connection::mConnection.

◆ operator->() [1/2]

const Connection * audacity::sqlite::SafeConnection::Lock::operator-> ( ) const
noexcept

Definition at line 102 of file SafeConnection.cpp.

103{
104 return &mSafeConnection->mConnection;
105}

References audacity::sqlite::Connection::mConnection.

◆ operator->() [2/2]

Connection * audacity::sqlite::SafeConnection::Lock::operator-> ( )
noexcept

Definition at line 97 of file SafeConnection.cpp.

98{
99 return &mSafeConnection->mConnection;
100}

References audacity::sqlite::Connection::mConnection.

◆ operator=() [1/2]

Lock & audacity::sqlite::SafeConnection::Lock::operator= ( const Lock )
delete

◆ operator=() [2/2]

Lock & audacity::sqlite::SafeConnection::Lock::operator= ( Lock &&  )
default

Member Data Documentation

◆ mLock

std::unique_lock<MutexType> audacity::sqlite::SafeConnection::Lock::mLock
private

Definition at line 74 of file SafeConnection.h.

Referenced by Lock().

◆ mSafeConnection

std::shared_ptr<SafeConnection> audacity::sqlite::SafeConnection::Lock::mSafeConnection
private

Definition at line 73 of file SafeConnection.h.

Referenced by Lock().


The documentation for this struct was generated from the following files: