Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MutexLock< T > Class Template Reference

#include <ReadWriteLock.h>

+ Inheritance diagram for MutexLock< T >:

Public Member Functions

 MutexLock (T &m, std::function< int(T &)> &lock, std::function< int(T &)> &unlock)
 Construct and lock mutex. More...
 
virtual ~MutexLock ()
 Destruct and unlock mutex. More...
 
virtual int lock ()
 Explicitly lock mutex, need to make sure you do not get into racing condition. More...
 
virtual int unlock ()
 Explicitly unlock existing mutex. More...
 
virtual T & getLock ()
 

Static Public Member Functions

static int initFunctions ()
 

Static Public Attributes

static bool functionsAreInitialized
 
static std::function< int(pthread_mutex_t &)> plainLockLock
 
static std::function< int(pthread_mutex_t &)> plainLockUnlock
 
static std::function< int(pthread_rwlock_t &)> readLockLock
 
static std::function< int(pthread_rwlock_t &)> readLockUnock
 
static std::function< int(pthread_rwlock_t &)> writeLockLock
 
static std::function< int(pthread_rwlock_t &)> writeLockUnlock
 

Protected Attributes

T & m_
 
std::function< int(T &)> lockFunc
 
std::function< int(T &)> unlockFunc
 

Detailed Description

template<typename T>
class MutexLock< T >

Definition at line 61 of file ReadWriteLock.h.

Constructor & Destructor Documentation

template<typename T>
MutexLock< T >::MutexLock ( T &  m,
std::function< int(T &)> &  lock,
std::function< int(T &)> &  unlock 
)
inline

Construct and lock mutex.

Definition at line 69 of file ReadWriteLock.h.

template<typename T>
virtual MutexLock< T >::~MutexLock ( )
inlinevirtual

Destruct and unlock mutex.

Definition at line 75 of file ReadWriteLock.h.

Member Function Documentation

template<typename T>
virtual T& MutexLock< T >::getLock ( )
inlinevirtual

Definition at line 86 of file ReadWriteLock.h.

template<typename T>
virtual int MutexLock< T >::lock ( )
inlinevirtual

Explicitly lock mutex, need to make sure you do not get into racing condition.

Definition at line 79 of file ReadWriteLock.h.

template<typename T>
virtual int MutexLock< T >::unlock ( )
inlinevirtual

Explicitly unlock existing mutex.

Definition at line 83 of file ReadWriteLock.h.

Member Data Documentation

bool MutexLockBase::functionsAreInitialized
staticinherited

Definition at line 20 of file ReadWriteLock.h.

Referenced by MutexLockBase::initFunctions(), and MutexLockBase::MutexLockBase().

template<typename T>
std::function<int(T&)> MutexLock< T >::lockFunc
protected
std::function<int(pthread_mutex_t&)> MutexLockBase::plainLockLock
staticinherited

Definition at line 48 of file ReadWriteLock.h.

Referenced by MutexLockBase::initFunctions().

std::function<int(pthread_mutex_t&)> MutexLockBase::plainLockUnlock
staticinherited

Definition at line 49 of file ReadWriteLock.h.

Referenced by MutexLockBase::initFunctions().

std::function<int(pthread_rwlock_t&)> MutexLockBase::readLockLock
staticinherited

Definition at line 51 of file ReadWriteLock.h.

Referenced by MutexLockBase::initFunctions().

std::function<int(pthread_rwlock_t&)> MutexLockBase::readLockUnock
staticinherited

Definition at line 52 of file ReadWriteLock.h.

Referenced by MutexLockBase::initFunctions().

template<typename T>
std::function<int(T&)> MutexLock< T >::unlockFunc
protected
std::function<int(pthread_rwlock_t&)> MutexLockBase::writeLockLock
staticinherited

Definition at line 54 of file ReadWriteLock.h.

Referenced by MutexLockBase::initFunctions().

std::function<int(pthread_rwlock_t&)> MutexLockBase::writeLockUnlock
staticinherited

Definition at line 55 of file ReadWriteLock.h.

Referenced by MutexLockBase::initFunctions().


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