oasys::ScopeLock Class Reference

#include <Lock.h>

List of all members.


Detailed Description

Scope based lock created from a Lock.

Holds the lock until the object is destructed. Example of use:

 {
     Mutex m;
     ScopeLock lock(&m);
     // protected code
     ...
 }

Definition at line 173 of file Lock.h.

Public Member Functions

 ScopeLock (Lock *l, const char *lock_user)
 ScopeLock (const Lock *l, const char *lock_user)
 ScopeLock (oasys::ScopePtr< Lock > l, const char *lock_user)
 ScopeLock (std::auto_ptr< Lock > l, const char *lock_user)
void do_lock (const char *lock_user)
void unlock ()
 ~ScopeLock ()

Protected Attributes

Locklock_


Constructor & Destructor Documentation

oasys::ScopeLock::ScopeLock ( Lock l,
const char *  lock_user 
) [inline]

Definition at line 175 of file Lock.h.

References do_lock().

oasys::ScopeLock::ScopeLock ( const Lock l,
const char *  lock_user 
) [inline]

Definition at line 182 of file Lock.h.

References do_lock().

oasys::ScopeLock::ScopeLock ( oasys::ScopePtr< Lock l,
const char *  lock_user 
) [inline]

Definition at line 189 of file Lock.h.

References do_lock().

oasys::ScopeLock::ScopeLock ( std::auto_ptr< Lock l,
const char *  lock_user 
) [inline]

Definition at line 196 of file Lock.h.

References do_lock().

oasys::ScopeLock::~ScopeLock (  )  [inline]

Definition at line 215 of file Lock.h.

References lock_, and unlock().


Member Function Documentation

void oasys::ScopeLock::do_lock ( const char *  lock_user  )  [inline]

Definition at line 203 of file Lock.h.

References ASSERT, oasys::Lock::lock(), lock_, and oasys::Lock::scope_lock_count_.

Referenced by ScopeLock().

void oasys::ScopeLock::unlock (  )  [inline]

Definition at line 209 of file Lock.h.

References lock_, oasys::Lock::scope_lock_count_, and oasys::Lock::unlock().

Referenced by ~ScopeLock().


Member Data Documentation

Lock* oasys::ScopeLock::lock_ [protected]

Definition at line 223 of file Lock.h.

Referenced by do_lock(), unlock(), and ~ScopeLock().


The documentation for this class was generated from the following file:
Generated on Fri Dec 22 14:48:07 2006 for DTN Reference Implementation by  doxygen 1.5.1