CppCommon  1.0.4.1
C++ Common Library
Public Member Functions | List of all members
CppCommon::WriteLocker< T > Class Template Reference

Write locker synchronization primitive. More...

#include <locker.h>

Public Member Functions

 WriteLocker (T &primitive)
 Default class constructor. More...
 
 WriteLocker (const WriteLocker &)=delete
 
 WriteLocker (WriteLocker &&)=delete
 
 ~WriteLocker ()
 
WriteLockeroperator= (const WriteLocker &)=delete
 
WriteLockeroperator= (WriteLocker &&)=delete
 

Detailed Description

template<class T>
class CppCommon::WriteLocker< T >

Write locker synchronization primitive.

A write locker is an object that manages a given read/write synchronization primitive by keeping it always locked for write (write-lock in constructor and write-unlock in destructor).

Thread-safe.

Examples
threads_file_lock.cpp, and threads_rw_lock.cpp.

Definition at line 76 of file locker.h.

Constructor & Destructor Documentation

◆ WriteLocker() [1/3]

template<class T >
CppCommon::WriteLocker< T >::WriteLocker ( T &  primitive)
inlineexplicit

Default class constructor.

Parameters
primitive- Synchronization primitive to manage

Definition at line 83 of file locker.h.

◆ WriteLocker() [2/3]

template<class T >
CppCommon::WriteLocker< T >::WriteLocker ( const WriteLocker< T > &  )
delete

◆ WriteLocker() [3/3]

template<class T >
CppCommon::WriteLocker< T >::WriteLocker ( WriteLocker< T > &&  )
delete

◆ ~WriteLocker()

template<class T >
CppCommon::WriteLocker< T >::~WriteLocker ( )
inline

Definition at line 86 of file locker.h.

Member Function Documentation

◆ operator=() [1/2]

template<class T >
WriteLocker& CppCommon::WriteLocker< T >::operator= ( const WriteLocker< T > &  )
delete

◆ operator=() [2/2]

template<class T >
WriteLocker& CppCommon::WriteLocker< T >::operator= ( WriteLocker< T > &&  )
delete

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