join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
join::ScopedLock< Lockable > Class Template Reference

class owning a mutex for the duration of a scoped block. More...

#include <mutex.hpp>

Public Member Functions

 ScopedLock ()=delete
 default constructor.
 
 ScopedLock (Lockable &mutex)
 acquires ownership of the given mutex.
 
 ScopedLock (const ScopedLock &other)=delete
 copy constructor.
 
ScopedLockoperator= (const ScopedLock &other)=delete
 copy assignment.
 
 ScopedLock (ScopedLock &&other)=delete
 move constructor.
 
ScopedLockoperator= (ScopedLock &&other)=delete
 move assignment.
 
 ~ScopedLock ()
 releases the ownership of the owned mutex.
 
Lockable * mutex () const
 get associated mutex.
 

Detailed Description

template<typename Lockable>
class join::ScopedLock< Lockable >

class owning a mutex for the duration of a scoped block.

Constructor & Destructor Documentation

◆ ScopedLock() [1/4]

template<typename Lockable >
join::ScopedLock< Lockable >::ScopedLock ( )
delete

default constructor.

◆ ScopedLock() [2/4]

template<typename Lockable >
join::ScopedLock< Lockable >::ScopedLock ( Lockable & mutex)
inlineexplicit

acquires ownership of the given mutex.

Parameters
mutexmutex to acquire ownership of.

◆ ScopedLock() [3/4]

template<typename Lockable >
join::ScopedLock< Lockable >::ScopedLock ( const ScopedLock< Lockable > & other)
delete

copy constructor.

Parameters
otherother object to copy.

◆ ScopedLock() [4/4]

template<typename Lockable >
join::ScopedLock< Lockable >::ScopedLock ( ScopedLock< Lockable > && other)
delete

move constructor.

Parameters
otherother object to move.

◆ ~ScopedLock()

template<typename Lockable >
join::ScopedLock< Lockable >::~ScopedLock ( )
inline

releases the ownership of the owned mutex.

Member Function Documentation

◆ mutex()

template<typename Lockable >
Lockable * join::ScopedLock< Lockable >::mutex ( ) const
inline

get associated mutex.

Returns
associated mutex.

◆ operator=() [1/2]

template<typename Lockable >
ScopedLock & join::ScopedLock< Lockable >::operator= ( const ScopedLock< Lockable > & other)
delete

copy assignment.

Parameters
otherother object to copy.
Returns
a reference to the current object.

◆ operator=() [2/2]

template<typename Lockable >
ScopedLock & join::ScopedLock< Lockable >::operator= ( ScopedLock< Lockable > && other)
delete

move assignment.

Parameters
otherother object to move.
Returns
a reference to the current object.

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