BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT > Class Template Reference

This class is the implementation of the read/write lock. More...

#include <GenericRWLockImpl.hpp>

List of all members.

Classes

struct  LockerInfo

Public Member Functions

 GenericRWLockImpl ()
 ~GenericRWLockImpl ()
void acquireReadLock (const IdT id, const Timeout &timeout)
void acquireWriteLock (const IdT id, const Timeout &timeout)
void releaseReadLock (const IdT id)
void releaseWriteLock (const IdT id)

Private Types

typedef std::map< IdT,
LockerInfo, CompareT > 
IdMap

Private Member Functions

 GenericRWLockImpl (const GenericRWLockImpl &)
GenericRWLockImploperator= (const GenericRWLockImpl &)

Private Attributes

Condition m_waiting_writers
bool m_canRead
Condition m_waiting_readers
NonRecursiveMutex m_guard
unsigned m_numReaders
unsigned m_numWriters
IdMap m_lockerInfo

Detailed Description

template<typename IdT, typename CompareT>
class BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >

This class is the implementation of the read/write lock.

It isn't thread specific and thus may be used for other types of locking, such as for transactions which may span threads, in which case the transaction would be the id. The read/write lock is recursive and also supports upgrading a read-lock to a write lock.

Definition at line 64 of file GenericRWLockImpl.hpp.


Member Typedef Documentation

template<typename IdT, typename CompareT>
typedef std::map<IdT, LockerInfo, CompareT> BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::IdMap [private]

Definition at line 120 of file GenericRWLockImpl.hpp.


Constructor & Destructor Documentation

template<typename IdT , typename CompareT >
BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::GenericRWLockImpl (  )  [inline]

Definition at line 130 of file GenericRWLockImpl.hpp.

template<typename IdT , typename CompareT >
BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::~GenericRWLockImpl (  )  [inline]

Definition at line 138 of file GenericRWLockImpl.hpp.

template<typename IdT, typename CompareT>
BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::GenericRWLockImpl ( const GenericRWLockImpl< IdT, CompareT > &   )  [private]

Member Function Documentation

template<typename IdT, typename CompareT >
void BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::acquireReadLock ( const IdT  id,
const Timeout timeout 
) [inline]
template<typename IdT, typename CompareT >
void BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::acquireWriteLock ( const IdT  id,
const Timeout timeout 
) [inline]
template<typename IdT, typename CompareT>
GenericRWLockImpl& BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::operator= ( const GenericRWLockImpl< IdT, CompareT > &   )  [private]
template<typename IdT, typename CompareT >
void BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::releaseReadLock ( const IdT  id  )  [inline]
template<typename IdT, typename CompareT >
void BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::releaseWriteLock ( const IdT  id  )  [inline]

Member Data Documentation

template<typename IdT, typename CompareT>
bool BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::m_canRead [private]
template<typename IdT, typename CompareT>
NonRecursiveMutex BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::m_guard [private]
template<typename IdT, typename CompareT>
IdMap BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::m_lockerInfo [private]
template<typename IdT, typename CompareT>
unsigned BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::m_numReaders [private]
template<typename IdT, typename CompareT>
unsigned BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::m_numWriters [private]
template<typename IdT, typename CompareT>
Condition BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::m_waiting_readers [private]
template<typename IdT, typename CompareT>
Condition BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::m_waiting_writers [private]

The documentation for this class was generated from the following file:
Generated on Mon Jul 5 19:59:42 2010 for blocxx by  doxygen 1.6.3