MVault 1.0.0
Simple c++ database
Loading...
Searching...
No Matches
Public Member Functions | List of all members
mvlt::ReadLock< Mutex > Class Template Reference

A class for blocking a stream for reading. More...

#include <ReadWriteMutex.h>

Public Member Functions

 ReadLock () noexcept=delete
 Deleted default constructor.
 
 ReadLock (const ReadLock< Mutex > &other) noexcept=delete
 Deleted copy constructor.
 
 ReadLock (ReadLock< Mutex > &&other) noexcept=delete
 Deleted move constructor.
 
 ReadLock (Mutex &mtx) noexcept
 Constructor.
 
ReadLock< Mutex > & operator= (const ReadLock< Mutex > &other) noexcept=delete
 Deleted assignment operator.
 
ReadLock< Mutex > & operator= (ReadLock< Mutex > &&other) noexcept=delete
 Deleted move assignment operator.
 
 ~ReadLock () noexcept
 Destructor.
 

Detailed Description

template<class Mutex>
class mvlt::ReadLock< Mutex >

A class for blocking a stream for reading.

In the constructor, this class captures Mutex and blocks it for reading, and unlocks it in the destructor.

Template Parameters
<Mutex>a mutex that supports read and write lock operations
ReadWriteMutexa standard mutex that supports read and write lock operations
RecursiveReadWriteMutexa recursive mutex that supports read and write lock operations

Constructor & Destructor Documentation

◆ ReadLock() [1/3]

template<class Mutex >
mvlt::ReadLock< Mutex >::ReadLock ( const ReadLock< Mutex > &  other)
deletenoexcept

Deleted copy constructor.

Parameters
[in]otherobject to copy

◆ ReadLock() [2/3]

template<class Mutex >
mvlt::ReadLock< Mutex >::ReadLock ( ReadLock< Mutex > &&  other)
deletenoexcept

Deleted move constructor.

Parameters
[in]otherobject to move

◆ ReadLock() [3/3]

template<class Mutex >
mvlt::ReadLock< Mutex >::ReadLock ( Mutex mtx)
inlineexplicitnoexcept

Constructor.

Lock thread to read

Parameters
[in]mtxmutex to capture and lock

◆ ~ReadLock()

template<class Mutex >
mvlt::ReadLock< Mutex >::~ReadLock ( )
inlinenoexcept

Destructor.

Unlock captured mutex

Member Function Documentation

◆ operator=() [1/2]

template<class Mutex >
ReadLock< Mutex > & mvlt::ReadLock< Mutex >::operator= ( const ReadLock< Mutex > &  other)
deletenoexcept

Deleted assignment operator.

Parameters
[in]otherobject to copy
Returns
returns a new object, with data from other

◆ operator=() [2/2]

template<class Mutex >
ReadLock< Mutex > & mvlt::ReadLock< Mutex >::operator= ( ReadLock< Mutex > &&  other)
deletenoexcept

Deleted move assignment operator.

Parameters
[in]otherobject to move
Returns
returns a new object, with data from other

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