Public Member Functions | List of all members
Celartem::ReaderWriterLockLockerTempl< isWriter > Class Template Reference

#include <cel_rwlock.h>

Public Member Functions

 ReaderWriterLockLockerTempl ()
 
 ReaderWriterLockLockerTempl (ReaderWriterLock &rwlock)
 
 ReaderWriterLockLockerTempl (ReaderWriterLockLockerTempl &rl)
 
ReaderWriterLockLockerTemploperator= (ReaderWriterLockLockerTempl &rl)
 
virtual ~ReaderWriterLockLockerTempl ()
 
void lock (ReaderWriterLock &rwlock)
 
void unlock ()
 
void swap (ReaderWriterLockLockerTempl &r)
 

Detailed Description

template<bool isWriter>
class Celartem::ReaderWriterLockLockerTempl< isWriter >

This template class is to lock ReaderWriterLock instances.

See Also
ReaderLock, WriterLock, ReaderWriterLock

Constructor & Destructor Documentation

template<bool isWriter>
Celartem::ReaderWriterLockLockerTempl< isWriter >::ReaderWriterLockLockerTempl ( )
inline

It does not take any parameter.

template<bool isWriter>
Celartem::ReaderWriterLockLockerTempl< isWriter >::ReaderWriterLockLockerTempl ( ReaderWriterLock rwlock)
inline

This constructor creates either of Writer or Reader lock instance and also lock the specified ReaderWriterLock instance.

Parameters
rwlockReaderWriterLock class instance.
template<bool isWriter>
Celartem::ReaderWriterLockLockerTempl< isWriter >::ReaderWriterLockLockerTempl ( ReaderWriterLockLockerTempl< isWriter > &  rl)
inline

This constructor duplicates the ReaderWriterLockLockerTempl itself. Please note that if the Writer-Lock is duplicated, causes a dead-lock because ReaderWriterLock usually could not accept two Writers.

Parameters
rlReaderWriterLockLockerTempl class instance.
template<bool isWriter>
virtual Celartem::ReaderWriterLockLockerTempl< isWriter >::~ReaderWriterLockLockerTempl ( )
inlinevirtual

This method also releases the last lock.

Member Function Documentation

template<bool isWriter>
void Celartem::ReaderWriterLockLockerTempl< isWriter >::lock ( ReaderWriterLock rwlock)
inline

This method locks the specified ReaderWriterLock instance.

Parameters
rwlockThe instance to lock.

Referenced by Celartem::ReaderWriterLockLockerTempl< isWriter >::operator=(), and Celartem::ReaderWriterLockLockerTempl< isWriter >::ReaderWriterLockLockerTempl().

template<bool isWriter>
ReaderWriterLockLockerTempl& Celartem::ReaderWriterLockLockerTempl< isWriter >::operator= ( ReaderWriterLockLockerTempl< isWriter > &  rl)
inline

This constructor duplicates the ReaderWriterLockLockerTempl itself. Please note that if the Writer-Lock is duplicated, causes a dead-lock because ReaderWriterLock usually could not accept two Writers.

Parameters
rlReaderWriterLockLockerTempl class instance.
template<bool isWriter>
void Celartem::ReaderWriterLockLockerTempl< isWriter >::swap ( ReaderWriterLockLockerTempl< isWriter > &  r)
inline

This method swaps the locking status each other.

Parameters
rA ReaderWriterLockLockerTempl instance with which exchange the locking status.
template<bool isWriter>
void Celartem::ReaderWriterLockLockerTempl< isWriter >::unlock ( )
inline

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

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:06.
Cuminas Logo