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 150 of file Lock.h.


Public Member Functions

 ScopeLock ()
 ScopeLock (Lock *l, const char *lock_user)
 ScopeLock (const Lock *l, const char *lock_user)
 ScopeLock (oasys::ScopePtr< Lock > l, const char *lock_user)
void set_lock (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 (  )  [inline]

Definition at line 152 of file Lock.h.

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

Definition at line 157 of file Lock.h.

References do_lock().

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

Definition at line 164 of file Lock.h.

References do_lock().

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

Definition at line 171 of file Lock.h.

References do_lock().

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

Definition at line 199 of file Lock.h.

References lock_, and unlock().


Member Function Documentation

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

Definition at line 178 of file Lock.h.

References do_lock(), and lock_.

Referenced by dtn::BundleDaemon::handle_link_state_change_request().

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

Definition at line 184 of file Lock.h.

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

Referenced by ScopeLock(), and set_lock().

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

Definition at line 191 of file Lock.h.

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

Referenced by dtn::ProphetTable::~ProphetTable(), and ~ScopeLock().


Member Data Documentation

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

Definition at line 207 of file Lock.h.

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


The documentation for this class was generated from the following file:
Generated on Sat Sep 8 08:43:54 2007 for DTN Reference Implementation by  doxygen 1.5.3