Audacity  2.2.2
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
BlockFile::ReadLock Class Reference

#include <BlockFile.h>

Inheritance diagram for BlockFile::ReadLock:
movable_ptr_with_deleter< T, Deleter >

Public Types

using Suspension = std::unique_ptr< const BlockFile, ReadLocker >
 

Public Member Functions

 ReadLock (ReadLock &&that)
 
Suspension Suspend () const
 
- Public Member Functions inherited from movable_ptr_with_deleter< T, Deleter >
 movable_ptr_with_deleter ()
 
 movable_ptr_with_deleter (T *p, const Deleter &d)
 
 movable_ptr_with_deleter (movable_ptr_with_deleter &&that)
 
movable_ptr_with_deleteroperator= (movable_ptr_with_deleter &&that)
 

Private Member Functions

 ReadLock (const BlockFile *p, const BlockFile::ReadUnlocker &u)
 

Private Attributes

friend BlockFile
 

Detailed Description

Definition at line 186 of file BlockFile.h.

Member Typedef Documentation

using BlockFile::ReadLock::Suspension = std::unique_ptr< const BlockFile, ReadLocker >

Definition at line 201 of file BlockFile.h.

Constructor & Destructor Documentation

BlockFile::ReadLock::ReadLock ( const BlockFile p,
const BlockFile::ReadUnlocker u 
)
inlineprivate

Definition at line 189 of file BlockFile.h.

190  : ReadLockBase { p, u } {}
movable_ptr_with_deleter< const BlockFile, ReadUnlocker > ReadLockBase
Definition: BlockFile.h:183
BlockFile::ReadLock::ReadLock ( ReadLock &&  that)
inline

Definition at line 200 of file BlockFile.h.

200 : ReadLockBase{ std::move(that) } {}
movable_ptr_with_deleter< const BlockFile, ReadUnlocker > ReadLockBase
Definition: BlockFile.h:183

Member Function Documentation

Suspension BlockFile::ReadLock::Suspend ( ) const
inline

Definition at line 202 of file BlockFile.h.

203  { if (get()) get()->UnlockRead();
204  return Suspension{ get(), ReadLocker{} }; }
virtual void UnlockRead() const
Allows reading on other threads.
Definition: BlockFile.h:176
std::unique_ptr< const BlockFile, ReadLocker > Suspension
Definition: BlockFile.h:201

Member Data Documentation

friend BlockFile::ReadLock::BlockFile
private

Definition at line 188 of file BlockFile.h.


The documentation for this class was generated from the following file: