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

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

#include <ReadWriteMutex.h>

Public Member Functions

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

Detailed Description

template<class Mutex>
class mvlt::WriteLock< Mutex >

A class for blocking a stream for writing.

In the constructor, this class captures Mutex and blocks it for writing, 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

◆ WriteLock() [1/3]

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

Deleted copy constructor.

Parameters
[in]otherobject to copy

◆ WriteLock() [2/3]

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

Deleted move constructor.

Parameters
[in]otherobject to move

◆ WriteLock() [3/3]

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

Constructor.

Lock thread to write

Parameters
[in]mtxmutex to capture and lock

◆ ~WriteLock()

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

Destructor.

Unlock captured mutex

Member Function Documentation

◆ operator=() [1/2]

template<class Mutex >
WriteLock< Mutex > & mvlt::WriteLock< Mutex >::operator= ( const WriteLock< 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 >
WriteLock< Mutex > & mvlt::WriteLock< Mutex >::operator= ( WriteLock< 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: