Public Types | Public Member Functions | Private Attributes
icl_core::thread::ScopedRWLock Class Reference

Manages locking and unlocking of a read-write lock. More...

#include <ScopedRWLock.h>

Inheritance diagram for icl_core::thread::ScopedRWLock:
Inheritance graph
[legend]

List of all members.

Public Types

enum  LockMode { eLM_READ_LOCK, eLM_WRITE_LOCK }
 The type of lock to obtain on the read-write lock. More...

Public Member Functions

bool isLocked () const
 operator bool () const
 ScopedRWLock (RWLock &lock, LockMode lock_mode, bool force=true)
 ~ScopedRWLock ()

Private Attributes

bool m_is_locked
RWLockm_lock

Detailed Description

Manages locking and unlocking of a read-write lock.

Locks or tries to lock a read-write lock in the constructor and unlocks it in the destructor.

Definition at line 50 of file ScopedRWLock.h.


Member Enumeration Documentation

The type of lock to obtain on the read-write lock.

Enumerator:
eLM_READ_LOCK 

Obtain a read lock.

eLM_WRITE_LOCK 

Obtain a write lock.

Definition at line 54 of file ScopedRWLock.h.


Constructor & Destructor Documentation

icl_core::thread::ScopedRWLock::ScopedRWLock ( RWLock lock,
LockMode  lock_mode,
bool  force = true 
) [explicit]

Locks the read-write lock.

Parameters:
lockThe read-write lock to use.
lock_modeUse eLM_READ_LOCK for a read lock, and eLM_WRITE_LOCK for a write lock.
forceEnsure at all cost that IsLocked() is true.

Definition at line 30 of file ScopedRWLock.cpp.

Unlocks the read-write lock.

Definition at line 43 of file ScopedRWLock.cpp.


Member Function Documentation

Check if the read-write lock has been successfully locked.

Definition at line 74 of file ScopedRWLock.h.

icl_core::thread::ScopedRWLock::operator bool ( ) const [inline]

Implicit conversion to bool.

Definition at line 79 of file ScopedRWLock.h.


Member Data Documentation

Definition at line 94 of file ScopedRWLock.h.

Definition at line 93 of file ScopedRWLock.h.


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


fzi_icl_core
Author(s):
autogenerated on Tue Aug 8 2017 02:28:05