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

Locker synchronization primitive. More...

#include <locker.h>

Public Member Functions

 Locker (T &primitive)
 Default class constructor. More...
 
 Locker (const Locker &)=delete
 
 Locker (Locker &&)=delete
 
 ~Locker ()
 
Lockeroperator= (const Locker &)=delete
 
Lockeroperator= (Locker &&)=delete
 

Detailed Description

template<class T>
class CppCommon::Locker< T >

Locker synchronization primitive.

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

Thread-safe.

Examples
threads_critical_section.cpp, threads_mutex.cpp, threads_spin_lock.cpp, and threads_thread.cpp.

Definition at line 22 of file locker.h.

Constructor & Destructor Documentation

◆ Locker() [1/3]

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

Default class constructor.

Parameters
primitive- Synchronization primitive to manage

Definition at line 29 of file locker.h.

◆ Locker() [2/3]

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

◆ Locker() [3/3]

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

◆ ~Locker()

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

Definition at line 32 of file locker.h.

Member Function Documentation

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

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