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

Read locker synchronization primitive. More...

#include <locker.h>

Public Member Functions

 ReadLocker (T &primitive)
 Default class constructor. More...
 
 ReadLocker (const ReadLocker &)=delete
 
 ReadLocker (ReadLocker &&)=delete
 
 ~ReadLocker ()
 
ReadLockeroperator= (const ReadLocker &)=delete
 
ReadLockeroperator= (ReadLocker &&)=delete
 

Detailed Description

template<class T>
class CppCommon::ReadLocker< T >

Read locker synchronization primitive.

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

Thread-safe.

Examples
threads_file_lock.cpp, and threads_rw_lock.cpp.

Definition at line 49 of file locker.h.

Constructor & Destructor Documentation

◆ ReadLocker() [1/3]

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

Default class constructor.

Parameters
primitive- Synchronization primitive to manage

Definition at line 56 of file locker.h.

◆ ReadLocker() [2/3]

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

◆ ReadLocker() [3/3]

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

◆ ~ReadLocker()

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

Definition at line 59 of file locker.h.

Member Function Documentation

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

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